From: fennecdjay Date: Sun, 8 Nov 2020 13:58:06 +0000 (+0100) Subject: :art: Remove useless code X-Git-Tag: nightly~1192 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=51cfc3d8458bb50be657165819de2529b1a2469c;p=gwion.git :art: Remove useless code --- diff --git a/include/env/oo.h b/include/env/oo.h index ba5d09c7..92f80343 100644 --- a/include/env/oo.h +++ b/include/env/oo.h @@ -8,25 +8,4 @@ typedef struct Nspc_ * Nspc; typedef struct Value_ * Value; typedef struct Func_ * Func; -typedef struct RefCount_ { - void (*free)(void*,void*); - uint16_t count; // could be an unsigned short -} RefCount; - -#define HAS_OBJ RefCount* ref; -ANN static inline RefCount* new_refcount(MemPool mp, void(*free)(void*,void*)) { - RefCount *ref = (RefCount*)mp_calloc(mp, RefCount); - ref->count = 1; - ref->free= free; - return ref; -} -#define new_refcount(a, b) new_refcount(a, (void(*)(void*,void*))b) -ANN static inline void rem_ref(MemPool mp, RefCount* a, void* ptr, void *gwion) { - if(--a->count) - return; - a->free(ptr, gwion); - mp_free(mp, RefCount, a); -} -#define ADD_REF(a) { ++(a)->ref->count; } -#define REM_REF(a, b) { rem_ref(((Gwion)(b))->mp, (a)->ref, (a), (b)); } #endif