File: malloc.c

package info (click to toggle)
unbound 1.24.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,436 kB
  • sloc: ansic: 138,476; sh: 6,860; yacc: 4,259; python: 1,950; makefile: 1,881; awk: 162; perl: 158; xml: 36
file content (20 lines) | stat: -rw-r--r-- 400 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Just a replacement, if the original malloc is not
   GNU-compliant. See autoconf documentation. */

#include "config.h"
#undef malloc
#include <sys/types.h>

/* provide a prototype */
void *malloc (size_t n);

/* Allocate an N-byte block of memory from the heap.
   If N is zero, allocate a 1-byte block.  */

void *
rpl_malloc_unbound (size_t n)
{
  if (n == 0)
    n = 1;
  return malloc (n);
}