diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-05-18 13:37:19 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-05-18 13:37:19 -0500 |
commit | 5382b1f1a4ae60ca663ae12740e319c5ad2b2b5c (patch) | |
tree | 0d8f539378b7fbd1db4e5590093469d9a1544b6a | |
parent | timeout - Use standard Makefile template (diff) | |
download | rtems-libbsd-5382b1f1a4ae60ca663ae12740e319c5ad2b2b5c.tar.bz2 |
rtems-bsd-malloc.c - Add _bsd_reallocf()
-rw-r--r-- | rtemsbsd/src/rtems-bsd-malloc.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/rtemsbsd/src/rtems-bsd-malloc.c b/rtemsbsd/src/rtems-bsd-malloc.c index 27faf3f4..244f6a66 100644 --- a/rtemsbsd/src/rtems-bsd-malloc.c +++ b/rtemsbsd/src/rtems-bsd-malloc.c @@ -96,8 +96,21 @@ _bsd_realloc( void *addr, unsigned long size, return p; } -#undef free +#undef reallocf +void * +_bsd_reallocf( void *addr, unsigned long size, + struct malloc_type *type, int flags) +{ + void *p = realloc(addr, size); + if (p == NULL) { + free(addr,NULL); + } + + return p; +} + +#undef free void _bsd_free(void *addr, struct malloc_type *mtp) { |