summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-09 21:24:30 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-09 21:24:30 +0000
commit7fbe6805671c0272311da886b6b4dfc1b537b605 (patch)
tree5f95454209a419d60f6b67156f64b4d14ab01e0c /cpukit/libcsupport
parent2008-01-09 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-7fbe6805671c0272311da886b6b4dfc1b537b605.tar.bz2
2008-01-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/Makefile.am: Add src/malloc_dirtier.c. * libcsupport/include/rtems/malloc.h: Add malloc dirty support. * libcsupport/src/malloc_p.h: Correct prototype.
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r--cpukit/libcsupport/Makefile.am2
-rw-r--r--cpukit/libcsupport/include/rtems/malloc.h17
-rw-r--r--cpukit/libcsupport/src/malloc_p.h2
3 files changed, 19 insertions, 2 deletions
diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am
index 67fc95d0db..a36ce089cc 100644
--- a/cpukit/libcsupport/Makefile.am
+++ b/cpukit/libcsupport/Makefile.am
@@ -84,7 +84,7 @@ MALLOC_C_FILES = src/malloc_initialize.c src/calloc.c src/malloc.c \
src/mallocinfo.c src/malloc_walk.c src/malloc_get_statistics.c \
src/malloc_report_statistics.c src/malloc_report_statistics_plugin.c \
src/malloc_statistics_helpers.c src/malloc_boundary.c src/posix_memalign.c \
- src/malloc_deferred.c src/malloc_sbrk_helpers.c
+ src/malloc_deferred.c src/malloc_sbrk_helpers.c src/malloc_dirtier.c
PASSWORD_GROUP_C_FILES = src/getpwent.c
diff --git a/cpukit/libcsupport/include/rtems/malloc.h b/cpukit/libcsupport/include/rtems/malloc.h
index 6bb152bbf9..e347082819 100644
--- a/cpukit/libcsupport/include/rtems/malloc.h
+++ b/cpukit/libcsupport/include/rtems/malloc.h
@@ -76,6 +76,23 @@ typedef struct {
extern rtems_malloc_sbrk_functions_t rtems_malloc_sbrk_helpers_table;
extern rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers;
+/*
+ * Malloc Plugin to Dirty Memory at Allocation Time
+ */
+typedef void (*rtems_malloc_dirtier_t)(void *, size_t);
+extern rtems_malloc_dirtier_t *rtems_malloc_dirty_helper;
+
+/** @brief Dirty memory function
+ *
+ * This method fills the specified area with a non-zero pattern
+ * to aid in debugging programs which do not initialize their
+ * memory allocated from the heap.
+ */
+void rtems_malloc_dirty_memory(
+ void *start,
+ size_t size
+);
+
/** @brief Print Malloc Statistic Usage Report
*
* This method fills in the called provided malloc statistics area.
diff --git a/cpukit/libcsupport/src/malloc_p.h b/cpukit/libcsupport/src/malloc_p.h
index 10642ba46a..1bca6e0d18 100644
--- a/cpukit/libcsupport/src/malloc_p.h
+++ b/cpukit/libcsupport/src/malloc_p.h
@@ -52,4 +52,4 @@ extern rtems_malloc_statistics_t rtems_malloc_statistics;
boolean malloc_is_system_state_OK(void);
void malloc_deferred_frees_initialize(void);
void malloc_deferred_frees_process(void);
-void malloc_defer_free(void *);
+void malloc_deferred_free(void *);