summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/malloc.c')
-rw-r--r--cpukit/libcsupport/src/malloc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/malloc.c b/cpukit/libcsupport/src/malloc.c
index ed053d6e8d..de63df6ea0 100644
--- a/cpukit/libcsupport/src/malloc.c
+++ b/cpukit/libcsupport/src/malloc.c
@@ -25,12 +25,14 @@
#include <assert.h>
#include <errno.h>
#include <string.h>
+#include <unistd.h> /* sbrk(2) */
rtems_id RTEMS_Malloc_Heap;
size_t RTEMS_Malloc_Sbrk_amount;
#ifdef RTEMS_DEBUG
#define MALLOC_STATS
+#define MALLOC_DIRTY
#endif
#ifdef MALLOC_STATS
@@ -202,7 +204,11 @@ void *malloc(
malloc_stats.max_depth = current_depth;
}
#endif
-
+
+#ifdef MALLOC_DIRTY
+ (void) memset(return_this, 0xCF, size);
+#endif
+
return return_this;
}
@@ -221,6 +227,8 @@ void *calloc(
if ( cptr )
memset( cptr, '\0', length );
+ MSBUMP(malloc_calls, -1); /* subtract off the malloc */
+
return cptr;
}