Checkpointing capabilities.
More...
|
#define | buddy_tree_visit(longest, on_visit) |
|
#define | buddy_block_copy_to_ckp(offset, len) |
|
#define | buddy_block_copy_from_ckp(offset, len) |
|
Checkpointing capabilities.
- Copyright
- Copyright (C) 2008-2022 HPDCS Group https://hpdcs.github.io
◆ buddy_block_copy_from_ckp
#define buddy_block_copy_from_ckp |
( |
|
offset, |
|
|
|
len |
|
) |
| |
Value: __extension__({ \
memcpy(self->base_mem + offset, ptr, len); \
ptr += len; \
})
◆ buddy_block_copy_to_ckp
#define buddy_block_copy_to_ckp |
( |
|
offset, |
|
|
|
len |
|
) |
| |
Value: __extension__({ \
memcpy(ptr, self->base_mem + offset, len); \
ptr += len; \
})
◆ buddy_tree_visit
#define buddy_tree_visit |
( |
|
longest, |
|
|
|
on_visit |
|
) |
| |
Value: __extension__({ \
bool __vis = false; \
uint_fast8_t __l = B_TOTAL_EXP; \
uint_fast32_t __i = 0; \
while(1) { \
uint_fast8_t __lon = (longest)[__i]; \
if(!__lon) { \
uint_fast32_t __len = 1U << __l; \
uint_fast32_t __o = ((__i + 1) << __l) - (1 << B_TOTAL_EXP); \
on_visit(__o, __len); \
} else if(__lon != __l) { \
__i = buddy_left_child(__i) + __vis; \
__vis = false; \
__l--; \
continue; \
} \
do { \
__vis = !(__i & 1U); \
__i = buddy_parent(__i); \
__l++; \
} while(__vis); \
\
if(__l > B_TOTAL_EXP) \
break; \
__vis = true; \
} \
})