示例#1
0
/*!
 * \brief Free all memory allocated for the domain
 * \param _d freed domain
 */
void free_udomain(udomain_t* _d) {
    int i;

    if (_d->table) {
	for (i = 0; i < _d->size; i++) {
	    lock_ulslot(_d, i);
	    deinit_slot(_d->table + i);
	    unlock_ulslot(_d, i);
	}
	shm_free(_d->table);
    }
    shm_free(_d);
}
示例#2
0
/*
 * Free all memory allocated for
 * the domain
 */
void free_pdomain(pdomain_t* _d)
{
	int i;
	
	lock_pdomain(_d);
	if (_d->table) {
		for(i = 0; i < _d->size; i++) {
			deinit_slot(_d->table + i);
		}
		mem_free(_d->table);
	}
	unlock_pdomain(_d);

        mem_free(_d);
}
示例#3
0
/*
 * Free all memory allocated for
 * the domain
 */
void free_udomain(udomain_t* _d)
{
	int i;
	
	lock_udomain(_d);
	if (_d->table) {
		for(i = 0; i < UDOMAIN_HASH_SIZE; i++) {
			deinit_slot(_d->table + i);
		}
		shm_free(_d->table);
	}
	unlock_udomain(_d);
	lock_destroy(&_d->lock);/* destroy the lock (required for SYSV sems!)*/

        shm_free(_d);
}