size_t size;
ts_allocate_ctor ctor;
ts_allocate_dtor dtor;
-#ifdef MBO_0
int done;
-#endif
} tsrm_resource_type;
next_p = p->next;
for (j=0; j<p->count; j++) {
if (p->storage[j]) {
-#ifdef MBO_0
if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j], &p->storage);
}
-#endif
free(p->storage[j]);
}
}
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].size = size;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].ctor = ctor;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].dtor = dtor;
-#ifdef MBO_0
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].done = 0;
-#endif
/* enlarge the arrays for the already active threads */
for (i=0; i<tsrm_tls_table_size; i++) {
tsrm_new_thread_begin_handler(thread_id, &((*thread_resources_ptr)->storage));
}
for (i=0; i<id_count; i++) {
-#if MBO_0
if (resource_types_table[i].done) {
(*thread_resources_ptr)->storage[i] = NULL;
} else
-#endif
{
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
if (resource_types_table[i].ctor) {
/* deallocates all occurrences of a given id */
void ts_free_id(ts_rsrc_id id)
{
-#ifdef MBO_0
int i;
int j = TSRM_UNSHUFFLE_RSRC_ID(id);
tsrm_mutex_unlock(tsmm_mutex);
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully freed resource id %d", id));
-#endif
}