2007-02-16 10:18:52 -05:00
|
|
|
/* Just a replacement, if the original malloc is not
|
|
|
|
|
GNU-compliant. See autoconf documentation. */
|
|
|
|
|
|
2009-03-23 10:59:58 -04:00
|
|
|
#include "config.h"
|
2009-07-16 06:17:52 -04:00
|
|
|
#undef malloc
|
2007-02-16 10:18:52 -05:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
2019-11-18 07:52:17 -05:00
|
|
|
#ifndef USE_WINSOCK
|
2025-04-02 02:25:42 -04:00
|
|
|
void *malloc (size_t n);
|
2019-11-18 07:52:17 -05:00
|
|
|
#else
|
|
|
|
|
/* provide a prototype */
|
|
|
|
|
void *malloc (size_t n);
|
|
|
|
|
#endif
|
2007-02-16 10:18:52 -05:00
|
|
|
|
|
|
|
|
/* Allocate an N-byte block of memory from the heap.
|
|
|
|
|
If N is zero, allocate a 1-byte block. */
|
|
|
|
|
|
|
|
|
|
void *
|
2009-07-16 06:17:52 -04:00
|
|
|
rpl_malloc_unbound (size_t n)
|
2007-02-16 10:18:52 -05:00
|
|
|
{
|
|
|
|
|
if (n == 0)
|
|
|
|
|
n = 1;
|
|
|
|
|
return malloc (n);
|
|
|
|
|
}
|