aboutsummaryrefslogtreecommitdiffstats
path: root/core/module-list.c
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-05 07:03:11 +0100
committereunhhu <[email protected]>2026-10-05 07:03:11 +0100
commit71f1de8416a01ce6305ec9c5ed29895f4344886b (patch)
treed6bbbd43bf469cf7488fd9ae071bab366d5887ba /core/module-list.c
parent07791a8b9f9c25e83ef849e1cea431ed25be7553 (diff)
downloadpure-71f1de8416a01ce6305ec9c5ed29895f4344886b.tar.gz
pure-71f1de8416a01ce6305ec9c5ed29895f4344886b.zip
Share an event's empty list as it is: a snapshot made every event's lists trees for the next event (021)
Diffstat (limited to 'core/module-list.c')
-rw-r--r--core/module-list.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/module-list.c b/core/module-list.c
index 0d53c60..3b9ca38 100644
--- a/core/module-list.c
+++ b/core/module-list.c
@@ -1147,7 +1147,8 @@ bool pure_list_lookup(const PureList *list, unsigned key_field, PureCell key, un
size_t pure_list_count(const PureList *list) { return list->count; }
PureList *pure_list_share(PureList *list, PureRetired *retired, uint64_t epoch) {
- if (!make_tree(list)) return NULL; /* a copy reads a tree */
+ /* A copy reads a tree; an empty list (an event's, between events) stays as it is. */
+ if (list->count && !make_tree(list)) return NULL;
PureList *copy = malloc(sizeof(*copy));
if (!copy) return NULL;
*copy = (PureList){.layout = list->layout, .root = list->root, .count = list->count, .bytes = list->bytes,