forked from enlightenment/efl
Fix couple of issues with MAGIC handling.
eina_magic.h MUST include eina_config.h, otherwise it will not consider EINA_MAGIC stuff. Worse than that, some files were including that directly and were considering EINA_MAGIC attribute even if the file that alloc'ed the memory were not! Also add missing EINA_MAGIC_SET() to iterators and accessors. SVN revision: 37960
This commit is contained in:
parent
08832b519b
commit
5939d76d9c
|
@ -19,6 +19,8 @@
|
|||
#ifndef EINA_MAGIC_H_
|
||||
#define EINA_MAGIC_H_
|
||||
|
||||
#include "eina_config.h"
|
||||
|
||||
#ifdef EINA_MAGIC_DEBUG
|
||||
|
||||
#include "eina_types.h"
|
||||
|
|
|
@ -286,6 +286,8 @@ _eina_hash_find_by_data(const Eina_Hash *hash, const void *data, int *key_hash,
|
|||
|
||||
for (hash_num = 0; hash_num < EINA_HASH_BUCKET_SIZE; hash_num++)
|
||||
{
|
||||
if (!hash->buckets[hash_num])
|
||||
continue;
|
||||
it = eina_rbtree_iterator_prefix(hash->buckets[hash_num]);
|
||||
eina_iterator_foreach(it, EINA_EACH(_eina_hash_rbtree_each), &each);
|
||||
eina_iterator_free(it);
|
||||
|
@ -1009,6 +1011,8 @@ eina_hash_iterator_data_new(const Eina_Hash *hash)
|
|||
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_eina_hash_iterator_get_container);
|
||||
it->iterator.free = FUNC_ITERATOR_FREE(_eina_hash_iterator_free);
|
||||
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
||||
return &it->iterator;
|
||||
}
|
||||
|
||||
|
@ -1030,6 +1034,8 @@ eina_hash_iterator_key_new(const Eina_Hash *hash)
|
|||
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_eina_hash_iterator_get_container);
|
||||
it->iterator.free = FUNC_ITERATOR_FREE(_eina_hash_iterator_free);
|
||||
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
||||
return &it->iterator;
|
||||
}
|
||||
|
||||
|
@ -1051,6 +1057,8 @@ eina_hash_iterator_tuple_new(const Eina_Hash *hash)
|
|||
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_eina_hash_iterator_get_container);
|
||||
it->iterator.free = FUNC_ITERATOR_FREE(_eina_hash_iterator_free);
|
||||
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
||||
return &it->iterator;
|
||||
}
|
||||
|
||||
|
|
|
@ -355,6 +355,8 @@ eina_inlist_iterator_new(const Eina_Inlist *list)
|
|||
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(eina_inlist_iterator_get_container);
|
||||
it->iterator.free = FUNC_ITERATOR_FREE(eina_inlist_iterator_free);
|
||||
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
||||
return &it->iterator;
|
||||
}
|
||||
|
||||
|
@ -380,5 +382,7 @@ eina_inlist_accessor_new(const Eina_Inlist *list)
|
|||
it->accessor.get_container = FUNC_ACCESSOR_GET_CONTAINER(eina_inlist_accessor_get_container);
|
||||
it->accessor.free = FUNC_ACCESSOR_FREE(eina_inlist_accessor_free);
|
||||
|
||||
EINA_MAGIC_SET(&it->accessor, EINA_MAGIC_ACCESSOR);
|
||||
|
||||
return &it->accessor;
|
||||
}
|
||||
|
|
|
@ -179,6 +179,8 @@ _eina_rbtree_iterator_build(const Eina_Rbtree *root, unsigned char mask)
|
|||
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_eina_rbtree_iterator_get_content);
|
||||
it->iterator.free = FUNC_ITERATOR_FREE(_eina_rbtree_iterator_free);
|
||||
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
||||
return &it->iterator;
|
||||
|
||||
on_error:
|
||||
|
|
Loading…
Reference in New Issue