Ejemplo n.º 1
0
/* Allocates and initializes a new slab for the given cache */
static struct slab *new_slab(struct slab_cache *cache)
{
	struct slab *slab = navi_critical_malloc(SLAB_SIZE);

	if (cache->flags & NAVI_SLAB_DOUBLY_LINKED)
		init_double(cache, slab);
	else
		init_single(cache, slab);

	slab->in_use = 0;
	return slab;
}
	void option::operator = (const char *d){
		init_single(d);
	}
	//옵션을 const char*형태로 받아들입니다. 이 경우, 오직 하나의 옵션만 설정됩니다. 만약 ""를 준다면 아무 값도 설정하지 않습니다. ex) void testa(option a = ""); testa("asd");
	option::option(const char* d){
		if ( std::string(d).empty() )
			return;
		init_single(d);
	}
	void option::operator = (const std::string &d) {
		init_single(d);
	}
	//옵션을 string형태로 받아들입니다. 이 경우, 오직 하나의 옵션만 설정됩니다.
	option::option(const std::string &d){
		if ( d.empty() )
			return;
		init_single(d);
	}