summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/src/rtems-bsd-malloc.c
diff options
context:
space:
mode:
authorJennifer Averett <jennifer.averett@oarcorp.com>2012-04-04 14:33:16 -0500
committerJennifer Averett <jennifer.averett@oarcorp.com>2012-04-04 14:33:16 -0500
commit1747b0c8e1607dd220aa53797b4dc0fbe8dab5b4 (patch)
tree3d4b03340d69dd743a9f830a68dec47a88179b69 /rtemsbsd/src/rtems-bsd-malloc.c
parentAdded empty prison_check method to resolve linker error with RealTek Nic. (diff)
downloadrtems-libbsd-1747b0c8e1607dd220aa53797b4dc0fbe8dab5b4.tar.bz2
Added _bsd_realloc method.
Diffstat (limited to 'rtemsbsd/src/rtems-bsd-malloc.c')
-rw-r--r--rtemsbsd/src/rtems-bsd-malloc.c14
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