Beispiel #1
0
static int
CTL_RUNNABLE_HANDLER(test_runnable)(void *ctx,
	enum ctl_query_source source,
	void *arg, struct ctl_indexes *indexes)
{
	UT_ASSERTeq(source, CTL_QUERY_PROGRAMMATIC);

	int *arg_runnable = arg;
	*arg_runnable = 0;

	return 0;
}

static const struct ctl_node CTL_NODE(test_index)[] = {
	CTL_LEAF_RO(index_value),
	CTL_NODE_END
};

static const struct ctl_node CTL_NODE(debug)[] = {
	CTL_LEAF_RO(test_ro),
	CTL_LEAF_WO(test_wo),
	CTL_LEAF_RUNNABLE(test_runnable),
	CTL_LEAF_RW(test_rw),
	CTL_INDEXED(test_index),
	CTL_LEAF_WO(test_config),
	CTL_LEAF_WO(test_config_complex_arg),

	CTL_NODE_END
};
Beispiel #2
0
	buckets = heap_get_arena_buckets(&pop->heap, arena_id);

	/* calculate number of reservation for arena using buckets */
	unsigned size = 0;
	for (int i = 0; i < MAX_ALLOCATION_CLASSES; ++i) {
		if (buckets[i] != NULL && buckets[i]->is_active)
			size += buckets[i]->active_memory_block->m.size_idx;
	}

	*arena_size = size * CHUNKSIZE;

	return 0;
}

static const struct ctl_node CTL_NODE(arena_id)[] = {
	CTL_LEAF_RO(size),

	CTL_NODE_END
};

static const struct ctl_node CTL_NODE(arena)[] = {
	CTL_INDEXED(arena_id),

	CTL_NODE_END
};

static const struct ctl_node CTL_NODE(thread)[] = {
	CTL_LEAF_RO(arena_id),

	CTL_NODE_END
};