5 #include <xtypes/xlock.h>
6 #include <xtypes/xheap.h>
7 #include <xtypes/domain.h>
8 #include <xtypes/xhash.h>
10 struct xobject_header {
11 XPTR_TYPE(struct xseg_object_handler) obj_h;
25 XPTR_TYPE(void) container;
28 uint64_t nr_allocated;
29 uint64_t allocated_space;
35 struct xobject_h *obj_h;
36 xhash_iter_t xhash_it;
41 void *xobj_get_obj(struct xobject_h * obj_h, uint32_t flags);
42 void xobj_put_obj(struct xobject_h * obj_h, void *ptr);
43 int xobj_alloc_obj(struct xobject_h * obj_h, uint64_t nr);
44 int xobj_handler_init(struct xobject_h *obj_h, void *container,
45 uint32_t magic, uint64_t size, struct xheap *heap);
47 void xobj_iter_init(struct xobject_h *obj_h, struct xobject_iter *it);
48 int xobj_iterate(struct xobject_h *obj_h, struct xobject_iter *it, void **obj);
49 int xobj_check(struct xobject_h *obj_h, void *obj);
50 int xobj_isFree(struct xobject_h *obj_h, void *obj);
52 int __xobj_check(struct xobject_h *obj_h, void *obj);
53 int __xobj_isFree(struct xobject_h *obj_h, void *obj);
56 //xobj_handler_destroy()
57 //releases allocated pages
59 //maybe we need lock free versions of get/put obj
62 //unsigned long xobj_get_objs(obj_h, flags, uint64_t nr, void **buf)
63 //which will put nr objects in buf