This commit is contained in:
nub31
2025-10-26 16:07:49 +01:00
parent 828e20ddb6
commit 3febaaea81
15 changed files with 256 additions and 44 deletions

13
runtime/ref.h Normal file
View File

@@ -0,0 +1,13 @@
#pragma once
#include <stddef.h>
typedef struct
{
int ref_count;
void (*destructor)(void *self);
} ref_header;
void *rc_alloc(size_t size, void (*destructor)(void *self));
void rc_retain(void *obj);
void rc_release(void *obj);