FinC编译器源代码

源代码在线查看: object.c

软件大小: 357 K
上传用户: superdavid
关键词: FinC 编译器 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				#include 								Object* object_new ()				{					Object* self;									self = (Object*)mem_new(sizeof(Object));					object_init_object (OBJECT (self), object_destroy);									return self;				}								void object_destroy (Object* self)				{					mem_destroy (self);				}								void object_init_object (Object* self, ObjectDestroy p_destroy)				{					self->refcount = 1;					self->destroy = p_destroy;				}								Object* object_addref (Object* self)				{					if (!self) return NULL;									self->refcount++;					return self;				}								void object_unref (Object* self)				{					if (!self||self->refcount==0) return;									self->refcount--;					if (self->refcount 					{						(*self->destroy) (self);					}				}							

相关资源