Ejemplo n.º 1
0
void DString_DeleteData( DString *self )
{
	int *data = (int*)self->chars - self->sharing;

	if( self->aux ){
		DStringAux_Delete( self->aux );
		self->aux = NULL;
	}

	if( data == NULL || data == dao_string ) return;

	if( self->sharing ){
#ifdef DAO_WITH_THREAD
		DMutex_Lock( & mutex_string_sharing );
#endif
		if( self->sharing ){
			data[0] -= 1;
			if( data[0] ==0 ) dao_free( data );
		}
#ifdef DAO_WITH_THREAD
		DMutex_Unlock( & mutex_string_sharing );
#endif
	}else{
		dao_free( data );
	}

	self->sharing = 0;
	self->chars = NULL;
}
Ejemplo n.º 2
0
void DaoObject_Delete( DaoObject *self )
{
	int i;
#ifdef DAO_USE_GC_LOGGER
	DaoObjectLogger_LogDelete( (DaoValue*) self );
#endif
	GC_DecRC( self->defClass );
	GC_DecRC( self->parent );
	if( self->isRoot ){
		for(i=0; i<self->valueCount; i++) GC_DecRC( self->objValues[i] );
		if( self->objValues != (DaoValue**) (self + 1) ) dao_free( self->objValues );
	}
	dao_free( self );
}
Ejemplo n.º 3
0
void DaoQueue_Delete( DaoQueue *self )
{
	QueueItem *item;
	while( self->tail != NULL ){
		item = self->tail;
		self->tail = item->previous;
		DaoGC_DecRC( item->value );
		dao_free( item );
	}
	DaoGC_DecRC( (DaoValue*)self->mtx );
	DaoGC_DecRC( (DaoValue*)self->pushvar );
	DaoGC_DecRC( (DaoValue*)self->popvar );
	DaoCstruct_Free( (DaoCstruct*)self );
	dao_free( self );
}
Ejemplo n.º 4
0
void DaoClass_Delete( DaoClass *self )
{
	GC_DecRC( self->clsType );
	DMap_Delete( self->abstypes );
	DMap_Delete( self->lookupTable );
	DMap_Delete( self->ovldRoutMap );
	DArray_Delete( self->constants );
	DArray_Delete( self->variables );
	DArray_Delete( self->instvars );
	DArray_Delete( self->objDataName );
	DArray_Delete( self->cstDataName );
	DArray_Delete( self->glbDataName );
	DArray_Delete( self->superClass );
	DArray_Delete( self->references );
	if( self->vtable ) DMap_Delete( self->vtable );
	if( self->protoValues ) DMap_Delete( self->protoValues );
#ifdef DAO_WITH_DYNCLASS
	if( self->typeHolders ){
		DArray_Delete( self->typeHolders );
		DArray_Delete( self->typeDefaults );
		DMap_Delete( self->instanceClasses );
	}
#endif

	DString_Delete( self->className );
	dao_free( self );
}
Ejemplo n.º 5
0
void DaoxNode_Delete( DaoxNode *self )
{
	DaoCstruct_Free( (DaoCstruct*) self );
	if( self->ins ) DList_Delete( self->ins );
	DList_Delete( self->outs );
	dao_free( self );
}
Ejemplo n.º 6
0
void DaoxFont_Delete( DaoxFont *self )
{
	DMap_Delete( self->glyphs );
	DString_Delete( self->buffer );
	DaoCstruct_Free( (DaoCstruct*) self );
	dao_free( self );
}
Ejemplo n.º 7
0
void DaoxDataColumn_Delete( DaoxDataColumn *self )
{
	DaoxDataColumn_Reset( self, 0 );
	DVector_Delete( self->cells );
	GC_DecRC( self->type );
	dao_free( self );
}
Ejemplo n.º 8
0
static void DaoCallServer_Delete( DaoCallServer *self )
{
	daoint i;
	for(i=0; i<self->threads->size; i++){
		DaoCallThread_Delete( (DaoCallThread*)self->threads->items.pVoid[i] );
	}
	for(i=0; i<self->caches->size; ++i){
		DaoTaskEvent_Delete( (DaoTaskEvent*) self->caches->items.pVoid[i] );
	}
	DList_Delete( self->threads );
	DList_Delete( self->functions );
	DList_Delete( self->parameters );
	DList_Delete( self->owners );
	DList_Delete( self->events );
	DList_Delete( self->events2 );
	DList_Delete( self->caches );
	DMap_Delete( self->waitings );
	DMap_Delete( self->pending );
	DMap_Delete( self->active );
	DMutex_Destroy( & self->mutex );
	DCondVar_Destroy( & self->condv );
	DCondVar_Destroy( & self->condv2 );
	DThread_Destroy( & self->timer );
	dao_free( self );
}
Ejemplo n.º 9
0
void DaoxProfiler_Delete( DaoxProfiler *self )
{
	DMutex_Destroy( & self->mutex );
	DMap_Delete( self->profile );
	DMap_Delete( self->one );
	dao_free( self );
}
Ejemplo n.º 10
0
static void DaoMethodFields_Delete( DaoMethodFields *self )
{
	DArray_Delete( self->names );
	DArray_Delete( self->perms );
	DArray_Delete( self->routines );
	dao_free( self );
}
Ejemplo n.º 11
0
void DaoLexer_Delete( DaoLexer *self )
{
	daoint i;
	for(i=0; i<self->tokbuf->size; ++i) DaoToken_Delete( self->tokbuf->items.pToken[i] );
	DArray_Delete( self->tokens );
	DArray_Delete( self->tokbuf );
	dao_free( self );
}
Ejemplo n.º 12
0
void DArray_Delete( DArray *self )
{
#ifdef DAO_GC_PROF
	daoCountArray --;
#endif
	DArray_Clear( self );
	dao_free( self );
}
Ejemplo n.º 13
0
void DaoStream_Delete( DaoStream *self )
{
	DaoStream_Close( self );
	DString_Delete( self->fname );
	DString_Delete( self->streamString );
	DaoCstruct_Free( (DaoCstruct*) self );
	dao_free( self );
}
Ejemplo n.º 14
0
Archivo: daoArray.c Proyecto: cosim/dao
void DArray_Delete( DArray *self )
{
#ifdef DAO_USE_GC_LOGGER
	daoCountArray --;
#endif
	DArray_Clear( self );
	dao_free( self );
}
Ejemplo n.º 15
0
void DaoXmlParser_Delete( DaoXmlParser *self )
{
	DString_Delete( self->key );
	DString_Delete( self->value );
	DString_Delete( self->escape );
	DMap_Delete( self->escapes );
	dao_free( self );
}
Ejemplo n.º 16
0
void DaoxGraph_Delete( DaoxGraph *self )
{
	DaoCstruct_Free( (DaoCstruct*) self );
	DList_Delete( self->nodes );
	DList_Delete( self->edges );
	GC_DecRC( self->nodeType );
	GC_DecRC( self->edgeType );
	dao_free( self );
}
Ejemplo n.º 17
0
Archivo: daoArray.c Proyecto: cosim/dao
void DArray_Clear( DArray *self )
{
	void **buf = self->items.pVoid - self->offset;
	DArray_DeleteItems( self, 0, self->size );
	if( buf ) dao_free( buf );
	self->items.pVoid = NULL;
	self->size = self->bufsize = 0;
	self->offset = 0;
}
Ejemplo n.º 18
0
void DaoState_Delete( DaoState *self )
{
	DaoGC_DecRC( self->state );
	DaoGC_DecRC( (DaoValue*)self->lock );
	DaoGC_DecRC( (DaoValue*)self->defmtx );
	DaoGC_DecRC( (DaoValue*)self->demands );
	DaoCstruct_Free( (DaoCstruct*)self );
	dao_free( self );
}
Ejemplo n.º 19
0
void DaoCinValue_Delete( DaoCinValue *self )
{
#ifdef DAO_USE_GC_LOGGER
	DaoObjectLogger_LogDelete( (DaoValue*) self );
#endif
	GC_DecRC( self->cintype );
	GC_DecRC( self->value );
	dao_free( self );
}
Ejemplo n.º 20
0
void DaoXmlDOM_Delete( DaoXmlDOM *self )
{
	daoint i;
	DaoXmlDOM_Reset( self );
	for(i=0; i<self->caches->size; ++i){
		DaoXmlNode_Delete( (DaoXmlNode*) self->caches->items.pVoid[i] );
	}
	DList_Delete( self->caches );
	dao_free( self );
}
Ejemplo n.º 21
0
static void DaoMT_RoutMutexSet( DMap *mutexes )
{
	DNode *it;
	for(it=DMap_First(mutexes); it; it=DMap_Next(mutexes,it)){
		DMutex *mutex = (DMutex*) it->value.pVoid;
		DMutex_Destroy( mutex );
		dao_free( mutex );
	}
	DMap_Delete( mutexes );
}
Ejemplo n.º 22
0
void DaoxDataFrame_Delete( DaoxDataFrame *self )
{
	int i;
	for(i=0; i<3; ++i) DArray_Delete( self->labels[i] );
	if( self->slices ) DArray_Delete( self->slices );
	DArray_Delete( self->columns );
	DArray_Delete( self->caches );
	GC_DecRC( self->original );
	dao_free( self );
}
Ejemplo n.º 23
0
void DList_Clear( DList *self )
{
	void **buf = self->items.pVoid - self->offset;
	DList_DeleteItems( self, 0, self->size );
	if( self->type == DAO_DATA_VALUE ) DaoGC_LockData();
	if( buf ) dao_free( buf );
	self->items.pVoid = NULL;
	self->size = self->bufsize = 0;
	self->offset = 0;
	if( self->type == DAO_DATA_VALUE ) DaoGC_UnlockData();
}
Ejemplo n.º 24
0
void DaoInterface_Delete( DaoInterface *self )
{
#ifdef DAO_USE_GC_LOGGER
	DaoObjectLogger_LogDelete( (DaoValue*) self );
#endif
	if( self->concretes ) DMap_Delete( self->concretes );
	GC_DecRC( self->abtype );
	DList_Delete( self->supers );
	DMap_Delete( self->methods );
	dao_free( self );
}
Ejemplo n.º 25
0
static void DaoFuture_Delete( DaoFuture *self )
{
	DaoCstruct_Free( (DaoCstruct*) self );
	GC_DecRC( self->value );
	GC_DecRC( self->actor );
	GC_DecRC( self->message );
	GC_DecRC( self->selected );
	GC_DecRC( self->process );
	GC_DecRC( self->precond );
	dao_free( self );
}
Ejemplo n.º 26
0
void DaoxWindow_Delete( DaoxWindow *self )
{
	//if( self->handle ) glfwDestroyWindow( self->handle );
	DaoCstruct_Free( (DaoCstruct*) self );
	GC_DecRC( self->context );
	GC_DecRC( self->painter );
	GC_DecRC( self->renderer );
	GC_DecRC( self->widget );
	GC_DecRC( self->model );
	DString_Delete( self->title );
	dao_free( self );
}
Ejemplo n.º 27
0
void DaoXmlNode_Delete( DaoXmlNode *self )
{
	daoint i;
	for(i=0; i<self->children->size; ++i){
		DaoXmlNode_Delete( (DaoXmlNode*) self->children->items.pVoid[i] );
	}
	DList_Delete( self->children );
	DString_Delete( self->name );
	DString_Delete( self->content );
	DMap_Delete( self->attributes );
	dao_free( self );
}
Ejemplo n.º 28
0
int DString_Match( DString *self, const char *pat, daoint *start, daoint *end )
{
	DString *str = DString_New();
	DaoRegex *regex;
	int rc;
	DString_SetChars( str, pat );
	regex = (DaoRegex*) dao_malloc( DaoRegex_CheckSize( str ) );
	DaoRegex_Init( regex, str );
	DString_Delete( str );
	rc = DaoRegex_Match( regex, self, start, end );
	dao_free( regex );
	return rc;
}
Ejemplo n.º 29
0
void DaoCinType_Delete( DaoCinType *self )
{
#ifdef DAO_USE_GC_LOGGER
	DaoObjectLogger_LogDelete( (DaoValue*) self );
#endif
	GC_DecRC( self->abstract );
	GC_DecRC( self->target );
	GC_DecRC( self->citype );
	GC_DecRC( self->vatype );
	DList_Delete( self->supers );
	DMap_Delete( self->methods );
	dao_free( self );
}
Ejemplo n.º 30
0
void DaoxResource_Delete( DaoxResource *self )
{
	DaoCstruct_Free( (DaoCstruct*) self );
	DMap_Delete( self->scenes );
	DMap_Delete( self->lights );
	DMap_Delete( self->cameras );
	DMap_Delete( self->images );
	DMap_Delete( self->textures );
	DMap_Delete( self->effects );
	DMap_Delete( self->materials );
	DMap_Delete( self->geometries );
	DMap_Delete( self->terrains );
	dao_free( self );
}