diff options
author | Will Estes <wlestes@users.sourceforge.net> | 2012-03-21 18:36:28 +0000 |
---|---|---|
committer | Will Estes <wlestes@users.sourceforge.net> | 2012-03-21 18:36:28 +0000 |
commit | 83f0c4cac94bfaab45ae5d1c227d0af30b5ff9bf (patch) | |
tree | 6cf9cb937b7aca96417bc2cb16a50d454c979342 /lib/malloc.c | |
parent | 0b1924073865a1124ba0d4813fc701653d6eb424 (diff) |
provide malloc() and realloc() for systems that do not have satisfactory versions; resolves #1899047
Diffstat (limited to 'lib/malloc.c')
-rwxr-xr-x | lib/malloc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/malloc.c b/lib/malloc.c new file mode 100755 index 0000000..d4c605f --- /dev/null +++ b/lib/malloc.c @@ -0,0 +1,17 @@ + #include <config.h>
+ #undef malloc
+
+ #include <sys/types.h>
+
+ void *malloc ();
+
+ /* Allocate an N-byte block of memory from the heap.
+ If N is zero, allocate a 1-byte block. */
+
+ void *
+ rpl_malloc (size_t n)
+ {
+ if (n == 0)
+ n = 1;
+ return malloc (n);
+ }
|