summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-12-05 15:29:53 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-12-05 15:29:53 +0000
commit289ad864a5597250d874d32b3e2019adcea42ac4 (patch)
tree87cf5b21c71df2d171c60af69d972c434b38e5f1
parentminor changes so it would compile in a cross environment (diff)
downloadrtems-289ad864a5597250d874d32b3e2019adcea42ac4.tar.bz2
bug fix in statistics from Tony Bennett (tbennett@divnc.com)
-rw-r--r--c/src/exec/libcsupport/src/malloc.c4
-rw-r--r--c/src/lib/libc/malloc.c4
-rw-r--r--cpukit/libcsupport/src/malloc.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/c/src/exec/libcsupport/src/malloc.c b/c/src/exec/libcsupport/src/malloc.c
index 8639198bed..ed053d6e8d 100644
--- a/c/src/exec/libcsupport/src/malloc.c
+++ b/c/src/exec/libcsupport/src/malloc.c
@@ -193,8 +193,10 @@ void *malloc(
#ifdef MALLOC_STATS
if (return_this)
{
+ unsigned32 actual_size;
unsigned32 current_depth;
- MSBUMP(lifetime_allocated, size);
+ status = rtems_region_get_segment_size(RTEMS_Malloc_Heap, return_this, &actual_size);
+ MSBUMP(lifetime_allocated, actual_size);
current_depth = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
if (current_depth > malloc_stats.max_depth)
malloc_stats.max_depth = current_depth;
diff --git a/c/src/lib/libc/malloc.c b/c/src/lib/libc/malloc.c
index 8639198bed..ed053d6e8d 100644
--- a/c/src/lib/libc/malloc.c
+++ b/c/src/lib/libc/malloc.c
@@ -193,8 +193,10 @@ void *malloc(
#ifdef MALLOC_STATS
if (return_this)
{
+ unsigned32 actual_size;
unsigned32 current_depth;
- MSBUMP(lifetime_allocated, size);
+ status = rtems_region_get_segment_size(RTEMS_Malloc_Heap, return_this, &actual_size);
+ MSBUMP(lifetime_allocated, actual_size);
current_depth = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
if (current_depth > malloc_stats.max_depth)
malloc_stats.max_depth = current_depth;
diff --git a/cpukit/libcsupport/src/malloc.c b/cpukit/libcsupport/src/malloc.c
index 8639198bed..ed053d6e8d 100644
--- a/cpukit/libcsupport/src/malloc.c
+++ b/cpukit/libcsupport/src/malloc.c
@@ -193,8 +193,10 @@ void *malloc(
#ifdef MALLOC_STATS
if (return_this)
{
+ unsigned32 actual_size;
unsigned32 current_depth;
- MSBUMP(lifetime_allocated, size);
+ status = rtems_region_get_segment_size(RTEMS_Malloc_Heap, return_this, &actual_size);
+ MSBUMP(lifetime_allocated, actual_size);
current_depth = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
if (current_depth > malloc_stats.max_depth)
malloc_stats.max_depth = current_depth;