mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
Delete refcount.h
This commit is contained in:
parent
69183e2d79
commit
d00c058c46
@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// ref counting
|
||||
typedef struct RefCounted {
|
||||
int count;
|
||||
void (*dtor)(void*);
|
||||
} RefCounted;
|
||||
|
||||
#define PK_INCREF(obj) (obj)->rc.count++
|
||||
#define PK_DECREF(obj) do { \
|
||||
if(--(obj)->rc.count == 0) { \
|
||||
(obj)->rc.dtor(obj); \
|
||||
free(obj); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user