aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2026-06-25 04:42:23 +0200
committerPaul Oliver <contact@pauloliver.dev>2026-06-28 02:50:18 +0200
commit95fd6ae836ab5fee7387f4df46b727165a05b723 (patch)
tree79c715d250f44c1aa1a0d05e65be313ae4cd3e15 /core
parent0f5581f53f73a92d33826c4771553a9683376e67 (diff)
Adds v1 unit tests and fixes bugs found by them
Diffstat (limited to 'core')
-rw-r--r--core/salis.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/salis.c b/core/salis.c
index dac9e52..bf7ec44 100644
--- a/core/salis.c
+++ b/core/salis.c
@@ -506,6 +506,7 @@ void core_init(struct Core *core, uint64_t *seed) {
core->pnum = CLONES;
core->pcap = CLONES;
core->plst = CLONES - 1;
+ core->pcur = CLONES - 1;
core->iviv = calloc(SYNC_INTERVAL, sizeof(uint8_t));
core->ivav = calloc(SYNC_INTERVAL, sizeof(uint64_t));
core->pvec = calloc(core->pcap, sizeof(struct Proc));
@@ -989,6 +990,12 @@ void salis_run_thread(uint64_t ns) {
}
void salis_sync(void) {
+#if !defined(NDEBUG)
+ for (int i = 0; i < CORES; ++i) {
+ assert(g_cores[i].ivpt == SYNC_INTERVAL);
+ }
+#endif
+
uint8_t *iviv0 = g_cores[0].iviv;
uint64_t *ivav0 = g_cores[0].ivav;