#include "setup.h"
#include "irc_dictionary.h"
-static BlockHeap *elem_heap = NULL;
+static rb_bh *elem_heap = NULL;
struct Dictionary
{
dtree->compare_cb = compare_cb;
if (!elem_heap)
- elem_heap = BlockHeapCreate(sizeof(struct DictionaryElement), 1024);
+ elem_heap = rb_bh_create(sizeof(struct DictionaryElement), 1024);
return dtree;
}
dtree->id = rb_strdup(name);
if (!elem_heap)
- elem_heap = BlockHeapCreate(sizeof(struct DictionaryElement), 1024);
+ elem_heap = rb_bh_create(sizeof(struct DictionaryElement), 1024);
return dtree;
}
dict->root->data = delem->data;
dict->count--;
- BlockHeapFree(elem_heap, delem);
+ rb_bh_free(elem_heap, delem);
}
}
}
if (destroy_cb != NULL)
(*destroy_cb)(n, privdata);
- BlockHeapFree(elem_heap, n);
+ rb_bh_free(elem_heap, n);
}
rb_free(dtree);
s_assert(data != NULL);
s_assert(irc_dictionary_find(dict, key) == NULL);
- delem = BlockHeapAlloc(elem_heap);
+ delem = rb_bh_alloc(elem_heap);
delem->key = key;
delem->data = data;
/* TBD: is this needed? --nenolod */
if (delem->key == NULL)
{
- BlockHeapFree(elem_heap, delem);
+ rb_bh_free(elem_heap, delem);
return NULL;
}
data = delem->data;
irc_dictionary_unlink_root(dtree);
- BlockHeapFree(elem_heap, delem);
+ rb_bh_free(elem_heap, delem);
return data;
}