*/
//bytes = xheap_get_chunk_size(xhash);
- xhash_init(xhash, 3, INTEGER);
+ xhash_init(xhash, 3, 0, INTEGER);
obj_h->allocated = XPTR_MAKE(xhash, container);
obj_h->list = 0;
obj_h->flags = 0;
new = xheap_allocate(heap, size);
if (!new)
goto err;
- xhash_resize(allocated, sizeshift, new);
+ xhash_resize(allocated, sizeshift, 0, new);
xheap_free(allocated);
allocated = new;
obj_h->allocated = XPTR_MAKE(allocated, container);
//consistent wit obj_size
int __xobj_check(struct xobject_h *obj_h, void *ptr)
{
- void *container = XPTR(&obj_h->container);
xhash_iter_t it;
uint64_t i, nr_objs;
+ xhashidx key, val;
+ void *mem;
+ void *obj;
+ void *container = XPTR(&obj_h->container);
xhash_t *allocated = XPTR_TAKE(obj_h->allocated, container);
xhash_iter_init(allocated, &it);
- xhashidx key, val;
while (xhash_iterate(allocated, &it, &key, &val)){
- void *mem = XPTR_TAKE(key, container);
- void *obj;
+ mem = XPTR_TAKE(key, container);
nr_objs = xheap_get_chunk_size(mem)/obj_h->obj_size;
for (i = 0; i < nr_objs; i++) {
obj = (void *) ((unsigned long) mem +
int __xobj_isFree(struct xobject_h *obj_h, void *ptr)
{
- int r = 0;
void *container = XPTR(&obj_h->container);
xptr node;
struct xobject *obj;