Beispiel #1
0
void libgomp_lithe_sched_decref(libgomp_lithe_sched_t *sched)
{
  if (__sync_add_and_fetch(&sched->refcnt, -1) == 0) {
    lithe_fork_join_sched_cleanup(&sched->sched);
    if (wfl_size(&sched_zombie_list) < 100)
      wfl_insert(&sched_zombie_list, sched);
    else
      free(sched);
  }
}
Beispiel #2
0
static void __ctx_free(libgomp_lithe_context_t *ctx)
{
	if (wfl_size(&context_zombie_list) < 1000) {
		wfl_insert(&context_zombie_list, ctx);
	} else {
		int stacksize = ctx->context.context.stack.size
		              + ctx->context.stack_offset;
		int ret = munmap(ctx->context.context.stack.bottom, stacksize);
		assert(!ret);
	}
}
Beispiel #3
0
/* This function frees a previously allocated sigdata struct. */
void free_sigdata(struct sigdata *sigdata)
{
	wfl_insert(&sigdata_list, sigdata);
}