You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TODO.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,12 +37,14 @@ module_ref should then return a new self_t* object, add it to a stack in module.
37
37
-[x] Add _clear function
38
38
-[x] Add tests!
39
39
-[x] Update doc!
40
+
-[x] Offer a stack_set_dtor() API to offer a callback to free each item when autofree is true
40
41
41
42
### Map API
42
43
-[x] Add _clear function
43
44
-[x] Add tests!
44
45
-[x] Fix issue in map_new if m->data calloc fails: map object was not memsetted to 0; it would lead to a crash when map_free was called
45
46
-[x] Update doc!
47
+
-[x] Offer a map_set_dtor() to offer a callback to free each item when autofree is true
46
48
47
49
### Fix
48
50
-[x] Actually honor current module's callback when flushing pubsub messages
@@ -54,7 +56,6 @@ module_ref should then return a new self_t* object, add it to a stack in module.
54
56
55
57
## 4.1.0
56
58
-[ ] PoisonPill message to automatically stop another module?
57
-
-[ ] Expose a queue and use it for internally storing each module's fds
58
59
59
60
## Ideas
60
61
-[ ] Let contexts talk together? Eg: broadcast(msg, bool global) to send a message to all modules in every context; module_publish message in another context? etc etc
Put a value inside hashmap. Note that if dupkey is true, key will be strdupped; it will also be automatically freed upon deletion.
58
+
Put a value inside hashmap. Note that if dupkey is true, key will be strdupped and its lifetime will be managed by libmodule.
56
59
57
60
:param m: pointer to map_t
58
61
:param key: key for this value
@@ -96,7 +99,7 @@ Where not specified, these functions return a map_ret_code.
96
99
97
100
.. c:function:: map_clear(m)
98
101
99
-
Clears a map object by deleting any object inside map, and eventually freeing it too if marked with autofree.
102
+
Clears a map object by deleting any object inside map, and eventually freeing it too if marked with autofree. Note that map dtor (if any) will be set to NULL too.
100
103
101
104
:param s: pointer to map_t
102
105
:type s::c:type:`map_t *`
@@ -115,3 +118,12 @@ Where not specified, these functions return a map_ret_code.
115
118
:param m: pointer to map_t
116
119
:type m::c:type:`map_t *`
117
120
:returns: map length or a map_ret_code if any error happens (map_t is null).
121
+
122
+
.. c:function:: map_set_dtor(m, fn)
123
+
124
+
Set a function to be called upon data deletion for autofree elements.
@@ -78,7 +81,7 @@ Where not specified, these functions return a stack_ret_code.
78
81
79
82
.. c:function:: stack_clear(s)
80
83
81
-
Clears a stack object by deleting any object inside stack, and eventually freeing it too if marked with autofree.
84
+
Clears a stack object by deleting any object inside stack, and eventually freeing it too if marked with autofree. Note that stack dtor (if any) will be set to NULL too.
82
85
83
86
:param s: pointer to stack_t
84
87
:type s::c:type:`stack_t *`
@@ -98,3 +101,11 @@ Where not specified, these functions return a stack_ret_code.
98
101
:type s::c:type:`stack_t *`
99
102
:returns: stack length or a stack_ret_code if any error happens (stack_t is null).
100
103
104
+
.. c:function:: stack_set_dtor(s, fn)
105
+
106
+
Set a function to be called upon data deletion for autofree elements.
0 commit comments