Revision 0bf9fcf7 xseg/xtypes/xobj.c
b/xseg/xtypes/xobj.c | ||
---|---|---|
13 | 13 |
else |
14 | 14 |
obj_h->obj_size = size; |
15 | 15 |
|
16 |
//TODO convert this to xset |
|
16 | 17 |
/* request space of an xhash of sizeshift 3 */ |
17 | 18 |
xhash = (xhash_t *) xheap_allocate(heap, xhash_get_alloc_size(3)); |
18 | 19 |
if (!xhash) |
... | ... | |
70 | 71 |
//ugly |
71 | 72 |
if (r == -XHASH_ERESIZE) { |
72 | 73 |
ul_t sizeshift = grow_size_shift(allocated); |
74 |
// printf("new sizeshift: %lu\n", sizeshift); |
|
73 | 75 |
uint64_t size; |
74 | 76 |
xhash_t *new; |
75 | 77 |
size = xhash_get_alloc_size(sizeshift); |
78 |
// printf("new size: %lu\n", size); |
|
76 | 79 |
//printf("%llu\n", xheap_get_chunk_size(allocated)); |
77 | 80 |
new = xheap_allocate(heap, size); |
78 | 81 |
// printf("requested %llu, got %llu\n", size, xheap_get_chunk_size(new)); |
... | ... | |
88 | 91 |
} |
89 | 92 |
} |
90 | 93 |
do { |
91 |
//assert obj_h->list == 0 |
|
92 | 94 |
objptr = obj_h->list; |
93 | 95 |
obj->next = objptr; |
94 | 96 |
}while(!__sync_bool_compare_and_swap(&obj_h->list, objptr, XPTR_MAKE((unsigned long) mem, container))); |
Also available in: Unified diff