Artifact f9de6a81daab9fe28bd0b09ff9cf2bd5cf81a8e4dc9d8d5882f4369468f21d93:
- File src/init.m — part of check-in [12cac9666a] at 2025-03-20 22:22:40 on branch trunk — Convert remaining files to pure Objective-C (user: js, size: 417) [annotate] [blame] [check-ins using]
#import "cube.h" static void **queue; static size_t queueCount; void enqueueInit(void (^init)(void)) { queue = realloc(queue, (queueCount + 1) * sizeof(void *)); if (queue == NULL) fatal(@"cannot allocate init queue"); queue[queueCount++] = (__bridge void *)init; } void processInitQueue(void) { for (size_t i = 0; i < queueCount; i++) ((__bridge void (^)())queue[i])(); free(queue); queueCount = 0; }