summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2024-10-19 16:06:09 +0200
committerJo-Philipp Wich <jo@mein.io>2024-12-02 15:25:39 +0100
commitefeb578065523b2882d71d91f38cd63115928b7a (patch)
tree43017d5d8683168f4a9ca2453fcf3d5f1975d34f /tests
parent47b54cf5a4b6166944efa4ee4cd023d73ebe6c3e (diff)
types, vm: refactor usage of global variables
Introduce an extensible private TLS context structure and use it within libucode to store global state such as active object iterators. This allows using libucode concurrently in multiple threads without unintentionally sharing global state among them. Also adjust the signal dispatching setup logic in `uc_vm_init()` to only enable signal handling if no other VM in the same thread already handles signals. Suggested-by: Isaac de Wolff <idewolff@vincitech.nl> [squash commits, move signal handler vm pointer and object iterator list into common extensible TLS context, whitespace and naming adjustments, extended signal setup logic] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/custom/03_stdlib/60_gc50
1 files changed, 25 insertions, 25 deletions
diff --git a/tests/custom/03_stdlib/60_gc b/tests/custom/03_stdlib/60_gc
index 28c0d00..44e5d9e 100644
--- a/tests/custom/03_stdlib/60_gc
+++ b/tests/custom/03_stdlib/60_gc
@@ -45,11 +45,11 @@ Returns an object count if the given operation is `count`.
-- End --
-- Expect stdout --
-Count #1: 6
-Count #2: 7
-Count #3: 6
-Count #4: 7
-Count #5: 6
+Count #1: 5
+Count #2: 6
+Count #3: 5
+Count #4: 6
+Count #5: 5
-- End --
@@ -84,24 +84,24 @@ Testing enabling the automatic collector.
-- End --
-- Expect stdout --
-Count #1: 7
-Count #2: 14
-Count #3: 14
-Count #4: 14
-Count #5: 14
-Count #6: 14
-Count #7: 14
-Count #8: 14
-Count #9: 14
-Count #10: 14
-Count #11: 14
-Count #12: 24
-Count #13: 34
-Count #14: 44
-Count #15: 54
-Count #16: 64
-Count #17: 74
-Count #18: 84
-Count #19: 94
-Count #20: 104
+Count #1: 6
+Count #2: 12
+Count #3: 12
+Count #4: 12
+Count #5: 12
+Count #6: 12
+Count #7: 12
+Count #8: 12
+Count #9: 12
+Count #10: 12
+Count #11: 12
+Count #12: 22
+Count #13: 32
+Count #14: 42
+Count #15: 52
+Count #16: 62
+Count #17: 72
+Count #18: 82
+Count #19: 92
+Count #20: 102
-- End --