Remove mt-vlmcd target from peers Makefile
[archipelago] / xseg / xtypes / xobj.c
index 0857aea..61a0fb8 100644 (file)
@@ -60,7 +60,7 @@ int xobj_handler_init(struct xobject_h *obj_h, void *container,
         */
        //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;
@@ -118,7 +118,7 @@ int xobj_alloc_obj(struct xobject_h * obj_h, uint64_t nr)
                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);
@@ -229,15 +229,16 @@ int xobj_iterate(struct xobject_h *obj_h, struct xobject_iter *it, void **obj)
 //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 +
@@ -261,7 +262,6 @@ int xobj_check(struct xobject_h *obj_h, void *ptr)
 
 int __xobj_isFree(struct xobject_h *obj_h, void *ptr)
 {
-       int r = 0;
        void *container = XPTR(&obj_h->container);
        xptr node;
        struct xobject *obj;