1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-15 18:23:35 +00:00
lovr/src/core/ref.c
bjorn 22fe333150 Update refcounting (again);
- Ref struct only stores refcount now and is more general.
- Proxy stores a hash of its type name instead of an enum.
- Variants store additional information instead of using a vtable.
- Remove the concept of superclasses from the API.
- Clean up some miscellaneous includes.
2019-06-02 01:02:26 -07:00

10 lines
198 B
C

#include "ref.h"
#include "util.h"
#include <stdlib.h>
void* _lovrAlloc(size_t size) {
Ref* ref = calloc(1, sizeof(Ref) + size);
lovrAssert(ref, "Out of memory");
return *ref = 1, ref + 1;
}