7#ifndef TOY_REFFUNCTION_H_
8#define TOY_REFFUNCTION_H_
23typedef void* (*Toy_RefFunctionAllocatorFn)(
void *pointer,
size_t oldSize,
size_t newSize);
Definition: toy_reffunction.h:39
unsigned char data[]
Definition: toy_reffunction.h:42
size_t length
Definition: toy_reffunction.h:40
int refCount
Definition: toy_reffunction.h:41
TOY_API int Toy_countRefFunction(Toy_RefFunction *refFunction)
Returns the total number of references to refFunction, for debugging.
void *(* Toy_RefFunctionAllocatorFn)(void *pointer, size_t oldSize, size_t newSize)
@???@
Definition: toy_reffunction.h:23
TOY_API Toy_RefFunction * Toy_copyRefFunction(Toy_RefFunction *refFunction)
Increases the reference counter of refFunction by 1, before returning the given pointer.
TOY_API void Toy_deleteRefFunction(Toy_RefFunction *refFunction)
Reduces the refFunction's reference counter by 1 and, if it reaches 0, frees the memory.
TOY_API size_t Toy_lengthRefFunction(Toy_RefFunction *refFunction)
Returns the length of the underlying bytecode of refFunction.
TOY_API void Toy_setRefFunctionAllocatorFn(Toy_RefFunctionAllocatorFn)
Conforms to and is invoked by Toy's memory API, and generally shouldn't be used.
TOY_API Toy_RefFunction * Toy_deepCopyRefFunction(Toy_RefFunction *refFunction)
Behaves identically to Toy_copyRefFunction, except that it explicitly preforms a deep copy of the int...
TOY_API Toy_RefFunction * Toy_createRefFunction(const void *data, size_t length)
Returns a new Toy_RefFunction, containing a copy of data, or NULL on error. This function also sets t...