37 #include "avrmalloc.h" 48 AvrClass *klass =
avr_new (AvrClass, 1);
97 klass->destroy = destroy;
126 if (klass->ref_count == 0)
127 klass->destroy (klass);
#define avr_new(type, count)
Macro for allocating memory.
AvrClass * class_new(void)
This function should never be used.
void class_ref(AvrClass *klass)
Increments the reference count for the klass object.
void avr_free(void *ptr)
Free malloc'd memory.
void class_destroy(void *klass)
Releases resources allocated by class's <klass>_new() function.
void class_unref(AvrClass *klass)
Decrements the reference count for the klass object.
#define avr_error(fmt, args...)
Print an error message to stderr and terminate program.
void class_overload_destroy(AvrClass *klass, AvrClassFP_Destroy destroy)
Overload the default destroy method.
void class_construct(AvrClass *klass)
Initializes the AvrClass data structure.