summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/malloc_deferred.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-07-21 10:15:02 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-07-22 09:13:07 +0200
commit059529e685e059d366ee56aa6117ee0d4e899e66 (patch)
tree77255d92003c98d84f558f6dbc27d474a842cf83 /cpukit/libcsupport/src/malloc_deferred.c
parentposix: Fix double chain extract (diff)
downloadrtems-059529e685e059d366ee56aa6117ee0d4e899e66.tar.bz2
score: Add debug support to chains
This helps to detect * double insert, append, prepend errors, and * get from empty chain errors.
Diffstat (limited to 'cpukit/libcsupport/src/malloc_deferred.c')
-rw-r--r--cpukit/libcsupport/src/malloc_deferred.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/malloc_deferred.c b/cpukit/libcsupport/src/malloc_deferred.c
index 962ae3e81f..f37b852cba 100644
--- a/cpukit/libcsupport/src/malloc_deferred.c
+++ b/cpukit/libcsupport/src/malloc_deferred.c
@@ -127,9 +127,13 @@ void *rtems_heap_allocate_aligned_with_boundary(
void _Malloc_Deferred_free( void *p )
{
rtems_interrupt_lock_context lock_context;
+ rtems_chain_node *node;
+
+ node = (rtems_chain_node *) p;
rtems_interrupt_lock_acquire( &_Malloc_GC_lock, &lock_context );
- rtems_chain_append_unprotected( &_Malloc_GC_list, (rtems_chain_node *) p );
+ rtems_chain_initialize_node( node );
+ rtems_chain_append_unprotected( &_Malloc_GC_list, node );
rtems_interrupt_lock_release( &_Malloc_GC_lock, &lock_context );
}
#endif