ref
This commit is contained in:
13
runtime/ref.h
Normal file
13
runtime/ref.h
Normal 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);
|
||||
Reference in New Issue
Block a user