Exemple #1
0
int main() {
	slog_init(NULL, 0);
	int num_runs = 5;
#ifdef AURA_USE_BUFFER_POOL
	printf("Buffer pool enabled!");
#else
	printf("Buffer pool disabled!");
#endif

	struct aura_node *n = aura_open(TRANSPORT, NULL);
	printf("+GC -PREHEAT\n");
	aura_unhandled_evt_cb(n, unhandled_cb, (void *) 0);
	average_aggregate(n, run_first, num_runs, "call test");
//	average_aggregate(n, run_second, num_runs, "alloc/dealloc test");
	aura_close(n);

	n = aura_open(TRANSPORT, NULL);

	printf("+GC +PREHEAT\n");
	aura_unhandled_evt_cb(n, unhandled_cb, (void *) 0);
	aura_bufferpool_preheat(n, 512, 10);
	average_aggregate(n, run_first, num_runs, "call test");
//	average_aggregate(n, run_second, num_runs, "alloc/dealloc test");
	aura_close(n);

	n = aura_open(TRANSPORT, NULL);

	printf("-GC -PREHEAT\n");
	aura_unhandled_evt_cb(n, unhandled_cb, (void *) 0);
	n->gc_threshold = -1;
	average_aggregate(n, run_first, num_runs, "call test");
//	average_aggregate(n, run_second, num_runs, "alloc/dealloc test");
	aura_close(n);

	return 0;
}
Exemple #2
0
static int l_set_node_container(lua_State *L)
{
	struct laura_node *lnode;

	TRACE();
	aura_check_args(L, 2);
	if (!lua_isuserdata(L, 1))
		aura_typeerror(L, 1, "udata");

	if (!lua_istable(L, 2))
		aura_typeerror(L, 2, "table");

	lnode = lua_touserdata(L, 1);
	lnode->node_container = luaL_ref(L, LUA_REGISTRYINDEX);
	lnode->refs |= REF_NODE_CONTAINER;

	aura_unhandled_evt_cb(lnode->node, event_cb, lnode);

	return 0;
}