summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/heapallocate.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src/heapallocate.c')
-rw-r--r--cpukit/score/src/heapallocate.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/cpukit/score/src/heapallocate.c b/cpukit/score/src/heapallocate.c
index 597077e280..a76ac04f49 100644
--- a/cpukit/score/src/heapallocate.c
+++ b/cpukit/score/src/heapallocate.c
@@ -254,10 +254,6 @@ void *_Heap_Allocate_aligned_with_boundary(
} while ( search_again );
if ( alloc_begin != 0 ) {
- /* Statistics */
- ++stats->allocs;
- stats->searches += search_count;
-
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
_Heap_Check_allocation(
@@ -268,6 +264,14 @@ void *_Heap_Allocate_aligned_with_boundary(
alignment,
boundary
);
+
+ /* Statistics */
+ ++stats->allocs;
+ stats->searches += search_count;
+ stats->lifetime_allocated += _Heap_Block_size( block );
+ } else {
+ /* Statistics */
+ ++stats->failed_allocs;
}
/* Statistics */