snapshot v3/p3; WIP
This commit is contained in:
parent
5bc9ec7147
commit
0f79e5a5ec
2 changed files with 10 additions and 6 deletions
|
@ -27,7 +27,7 @@
|
||||||
#define INTEGRITY_CHK ((void)0)
|
#define INTEGRITY_CHK ((void)0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//define SNAPSHOTS
|
#define SNAPSHOTS
|
||||||
#define DOT
|
#define DOT
|
||||||
#define TEST_ARRAY_SIZE 10
|
#define TEST_ARRAY_SIZE 10
|
||||||
|
|
||||||
|
|
14
include/sl.h
14
include/sl.h
|
@ -1139,10 +1139,14 @@
|
||||||
return rc; \
|
return rc; \
|
||||||
\
|
\
|
||||||
/* (b) shallow copy */ \
|
/* (b) shallow copy */ \
|
||||||
memcpy(dest, src, sizeof(decl##_node_t)); \
|
size_t sle_arr_sz = sizeof(struct __skiplist_##decl_entry) * slist->slh_max; \
|
||||||
|
memcpy(dest, src, sizeof(decl##_node_t) + sle_arr_sz); \
|
||||||
|
\
|
||||||
|
/* (d) adjust pointer to sle_next for this node */ \
|
||||||
|
dest->field.sle_next = (decl##_node_t **)((uintptr_t)dest + sizeof(decl##_node_t)); \
|
||||||
\
|
\
|
||||||
if (!(src == slist->slh_head || src == slist->slh_tail)) { \
|
if (!(src == slist->slh_head || src == slist->slh_tail)) { \
|
||||||
/* (d) deep copy */ \
|
/* (e) deep copy */ \
|
||||||
archive_node_blk; \
|
archive_node_blk; \
|
||||||
if (rc) { \
|
if (rc) { \
|
||||||
prefix##skip_free_node_##decl(dest); \
|
prefix##skip_free_node_##decl(dest); \
|
||||||
|
@ -1619,7 +1623,7 @@
|
||||||
if (next) \
|
if (next) \
|
||||||
fprintf(os, "%p } |", (void *)next); \
|
fprintf(os, "%p } |", (void *)next); \
|
||||||
else \
|
else \
|
||||||
fprintf(os, "0x0 } |"); \
|
fprintf(os, "0x0 } |"); \
|
||||||
fflush(os); \
|
fflush(os); \
|
||||||
} \
|
} \
|
||||||
if (fn) { \
|
if (fn) { \
|
||||||
|
@ -1728,7 +1732,7 @@
|
||||||
if (next) \
|
if (next) \
|
||||||
fprintf(os, "%p }", (void *)next); \
|
fprintf(os, "%p }", (void *)next); \
|
||||||
else \
|
else \
|
||||||
fprintf(os, "0x0 }"); \
|
fprintf(os, "0x0 }"); \
|
||||||
__SKIP_IS_LAST_ENTRY_T2B() continue; \
|
__SKIP_IS_LAST_ENTRY_T2B() continue; \
|
||||||
fprintf(os, " | "); \
|
fprintf(os, " | "); \
|
||||||
} \
|
} \
|
||||||
|
@ -1776,7 +1780,7 @@
|
||||||
size_t th = slist->slh_head->field.sle_height; \
|
size_t th = slist->slh_head->field.sle_height; \
|
||||||
for (size_t lvl = th; lvl != (size_t)-1; lvl--) { \
|
for (size_t lvl = th; lvl != (size_t)-1; lvl--) { \
|
||||||
next = (node->field.sle_next[lvl] == slist->slh_tail) ? NULL : node->field.sle_next[lvl]; \
|
next = (node->field.sle_next[lvl] == slist->slh_tail) ? NULL : node->field.sle_next[lvl]; \
|
||||||
fprintf(os, "<w%lu> 0x0", lvl); \
|
fprintf(os, "<w%lu> 0x0", lvl); \
|
||||||
__SKIP_IS_LAST_ENTRY_T2B() continue; \
|
__SKIP_IS_LAST_ENTRY_T2B() continue; \
|
||||||
fprintf(os, " | "); \
|
fprintf(os, " | "); \
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Reference in a new issue