File: oct-memalloc.c

package info (click to toggle)
octave-ltfat 2.3.1%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,712 kB
  • sloc: ansic: 30,379; cpp: 8,808; java: 1,499; objc: 345; makefile: 248; xml: 182; python: 124; sh: 18; javascript: 12
file content (46 lines) | stat: -rw-r--r-- 663 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stdlib.h>
#include <stdio.h>
#include "stddef.h"
#include "fftw3.h"

void* ltfat_malloc (size_t n)
{
  void *outp;
  outp = fftw_malloc(n);
  if (outp == NULL)
  {
     puts("ltfat_malloc failed.");
     exit(1);
  }
  return outp;
}

void* ltfat_realloc (void *ptr, size_t n)
{
  void *outp;
  outp = realloc(ptr, n);
  if (outp == NULL)
  {
     puts("ltfat_realloc failed.");
     exit(1);
  }
  return outp;
}

void* ltfat_calloc (size_t nmemb, size_t size)
{
  void *outp;
  outp = calloc(nmemb, size);
  if (outp == NULL)
  {
     puts("ltfat_calloc failed.");
     exit(1);
  }
  return outp;
}

void ltfat_free(void *ptr)
{
  fftw_free(ptr);
}