diff options
author | Jennifer Averett <jennifer.averett@oarcorp.com> | 2012-04-04 14:33:16 -0500 |
---|---|---|
committer | Jennifer Averett <jennifer.averett@oarcorp.com> | 2012-04-04 14:33:16 -0500 |
commit | 1747b0c8e1607dd220aa53797b4dc0fbe8dab5b4 (patch) | |
tree | 3d4b03340d69dd743a9f830a68dec47a88179b69 /rtemsbsd | |
parent | Added empty prison_check method to resolve linker error with RealTek Nic. (diff) | |
download | rtems-libbsd-1747b0c8e1607dd220aa53797b4dc0fbe8dab5b4.tar.bz2 |
Added _bsd_realloc method.
Diffstat (limited to 'rtemsbsd')
-rw-r--r-- | rtemsbsd/src/rtems-bsd-malloc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/rtemsbsd/src/rtems-bsd-malloc.c b/rtemsbsd/src/rtems-bsd-malloc.c index 95b6132e..47355497 100644 --- a/rtemsbsd/src/rtems-bsd-malloc.c +++ b/rtemsbsd/src/rtems-bsd-malloc.c @@ -63,6 +63,20 @@ _bsd_malloc(unsigned long size, struct malloc_type *mtp, int flags) return p; } +#undef realloc +void * +_bsd_realloc( void *addr, unsigned long size, + struct malloc_type *type, int flags) +{ + void *p = realloc(addr, size); + + if ((flags & M_ZERO) != 0 && p != NULL) { + memset(p, 0, size); + } + + return p; +} + #undef free void |