ASAN/LSAN more fixes, now including snapshots
This commit is contained in:
parent
5ccae6decf
commit
397259c09d
|
@ -20,7 +20,7 @@
|
|||
// ---------------------------------------------------------------------------
|
||||
#define TEST_ARRAY_SIZE 1000
|
||||
#define VALIDATE
|
||||
//define SNAPSHOTS
|
||||
#define SNAPSHOTS
|
||||
#define DOT
|
||||
#ifdef DOT
|
||||
size_t gen = 0;
|
||||
|
|
11
include/sl.h
11
include/sl.h
|
@ -1208,11 +1208,11 @@ void __attribute__((format(printf, 4, 5))) __skip_diag_(const char *file, int li
|
|||
if (slist == NULL) \
|
||||
return; \
|
||||
\
|
||||
prefix##skip_release_##decl(slist); \
|
||||
\
|
||||
if (slist->slh_fns.release_snapshots) \
|
||||
slist->slh_fns.release_snapshots(slist); \
|
||||
\
|
||||
prefix##skip_release_##decl(slist); \
|
||||
\
|
||||
free(slist->slh_head); \
|
||||
free(slist->slh_tail); \
|
||||
}
|
||||
|
@ -1247,6 +1247,7 @@ void __attribute__((format(printf, 4, 5))) __skip_diag_(const char *file, int li
|
|||
prefix##skip_free_node_##decl(slist, node); \
|
||||
node = next; \
|
||||
} \
|
||||
slist->slh_snap.pres = NULL; \
|
||||
slist->slh_snap.era = 0; \
|
||||
} \
|
||||
\
|
||||
|
@ -1354,7 +1355,7 @@ void __attribute__((format(printf, 4, 5))) __skip_diag_(const char *file, int li
|
|||
* can no longer access any generations > `era`. \
|
||||
* \
|
||||
* ALGORITHM: \
|
||||
* iterate over the preserved nodes (slist->slh_pres) \
|
||||
* iterate over the preserved nodes (slist->slh_snap.pres) \
|
||||
* a) remove/free nodes with node->era > era from slist \
|
||||
* b) remove/free nodes > era from slh_pres \
|
||||
* c) restore nodes == era by... \
|
||||
|
@ -1398,11 +1399,13 @@ void __attribute__((format(printf, 4, 5))) __skip_diag_(const char *file, int li
|
|||
slist->slh_snap.pres = node->field.sle_levels[0].next; \
|
||||
else { \
|
||||
if (node->field.sle_levels[0].next == NULL) \
|
||||
if (node == slist->slh_snap.pres) \
|
||||
slist->slh_snap.pres = NULL; \
|
||||
else \
|
||||
prev->field.sle_levels[0].next = NULL; \
|
||||
else \
|
||||
prev->field.sle_levels[0].next = node->field.sle_levels[0].next; \
|
||||
} \
|
||||
\
|
||||
prefix##skip_free_node_##decl(slist, node); \
|
||||
} \
|
||||
\
|
||||
|
|
Loading…
Reference in a new issue