summaryrefslogtreecommitdiff
path: root/rtl-sym.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-05-08 08:47:31 +1000
committerChris Johns <chrisj@rtems.org>2012-05-08 08:47:31 +1000
commitb78c02ab55ae3c0a932901896051617e1a212952 (patch)
treed8ce5cd954bc7d6a830d49f4e6abc210c77fefab /rtl-sym.c
parent7f7cdc2de97f006def935f3b2788a24dd25248eb (diff)
Add RTL allocator.
Add a custom allocator that can be hooked. The default heap allocator in this code does nothing more than wrap the libc heap allocator. Fix up the RTL initialise to better handle the locking and initialisation of internal structures.
Diffstat (limited to 'rtl-sym.c')
-rw-r--r--rtl-sym.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rtl-sym.c b/rtl-sym.c
index f4ca8f5..163b683 100644
--- a/rtl-sym.c
+++ b/rtl-sym.c
@@ -125,7 +125,7 @@ rtems_rtl_symbol_global_add (rtems_rtl_obj_t* obj,
printf ("rtl: global symbol add: %zi\n", count);
obj->global_size = count * sizeof (rtems_rtl_obj_sym_t);
- obj->global_table = malloc (obj->global_size);
+ obj->global_table = rtems_rtl_alloc_new (RTEMS_RTL_ALLOC_SYMBOL, obj->global_size);
if (!obj->global_table)
{
obj->global_size = 0;
@@ -221,7 +221,7 @@ rtems_rtl_obj_symbol_erase (rtems_rtl_obj_t* obj)
for (s = 0, sym = obj->global_table; s < obj->global_syms; ++s, ++sym)
if (!rtems_chain_is_node_off_chain (&sym->node))
rtems_chain_extract (&sym->node);
- free (obj->global_table);
+ rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_SYMBOL, obj->global_table);
obj->global_table = NULL;
obj->global_size = 0;
obj->global_syms = 0;