Unused for now.
while (current != NULL) {
previous = current;
current = current->next;
- xbt_dictelm_free(previous);
+ xbt_dictelm_free(*dict, previous);
(*dict)->count--;
}
}
if (current == NULL) {
/* this key doesn't exist yet */
- current = xbt_dictelm_new(key, key_len, hash_code, data, free_ctn);
+ current = xbt_dictelm_new(dict, key, key_len, hash_code, data, free_ctn);
dict->count++;
if (previous == NULL) {
dict->table[hash_code & dict->table_size] = current;
if (!dict->table[hash_code & dict->table_size])
dict->fill--;
- xbt_dictelm_free(current);
+ xbt_dictelm_free(dict, current);
dict->count--;
}
while (current != NULL) {
previous = current;
current = current->next;
- xbt_dictelm_free(previous);
+ xbt_dictelm_free(dict, previous);
}
dict->table[i] = NULL;
}
xbt_mallocator_t dict_elm_mallocator = NULL;
-xbt_dictelm_t xbt_dictelm_new(const char *key,
- int key_len,
- unsigned int hash_code,
- void *content, void_f_pvoid_t free_f)
+xbt_dictelm_t xbt_dictelm_new(xbt_dict_t dict, const char *key, int key_len,
+ unsigned int hash_code, void *content,
+ void_f_pvoid_t free_f)
{
xbt_dictelm_t element = xbt_mallocator_get(dict_elm_mallocator);
return element;
}
-void xbt_dictelm_free(xbt_dictelm_t element)
+void xbt_dictelm_free(xbt_dict_t dict, xbt_dictelm_t element)
{
if (element != NULL) {
xbt_free(element->key);
#define dict_elm_mallocator_reset_f ((void_f_pvoid_t)NULL)
/*####[ Function prototypes ]################################################*/
-xbt_dictelm_t xbt_dictelm_new(const char *key, int key_len,
+xbt_dictelm_t xbt_dictelm_new(xbt_dict_t dict, const char *key, int key_len,
unsigned int hash_code, void *content,
void_f_pvoid_t free_f);
-void xbt_dictelm_free(xbt_dictelm_t element);
+void xbt_dictelm_free(xbt_dict_t dict, xbt_dictelm_t element);
#endif /* _XBT_DICT_PRIVATE_H_ */