fix mt-mapperd pithos read bug. plus some minor fixes
[archipelago] / xseg / xtypes / xobj.h
index 4c66b35..ab821bd 100644 (file)
@@ -6,8 +6,6 @@
 #include <xtypes/xheap.h>
 #include <xtypes/domain.h>
 
-#define X_ALLOC ((uint32_t) (1 << 0))
-
 struct xobject_header {
        XPTR_TYPE(struct xseg_object_handler) obj_h;
 };
@@ -19,14 +17,17 @@ struct xobject {
 };
 
 struct xobject_h {
+       struct xlock lock;
        uint32_t magic;
        uint64_t obj_size;
        uint32_t flags;
        XPTR_TYPE(void) container;
        xptr heap;
        xptr allocated;
+       uint64_t nr_allocated;
+       uint64_t allocated_space;
        xptr list;
-       struct xlock lock;
+       uint64_t nr_free;
 };
 
 void *xobj_get_obj(struct xobject_h * obj_h, uint32_t flags);
@@ -38,4 +39,10 @@ int xobj_handler_init(struct xobject_h *obj_h, void *container,
 //TODO 
 //xobj_handler_destroy()
 //releases allocated pages
+//
+//maybe we need lock free versions of get/put obj
+//
+//also an
+//unsigned long xobj_get_objs(obj_h, flags, uint64_t nr, void **buf)
+//which will put nr objects in buf
 #endif