本网站可以出售:只需60000元直接拥有。QQ:939804642
您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ List_new函数代码示例

51自学网 2021-06-01 21:57:30
  C++
这篇教程C++ List_new函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中List_new函数的典型用法代码示例。如果您正苦于以下问题:C++ List_new函数的具体用法?C++ List_new怎么用?C++ List_new使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了List_new函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: IoObject_rawClonePrimitive

IoAudioMixer *IoAudioMixer_rawClone(IoAudioMixer *proto) { 	IoObject *self = IoObject_rawClonePrimitive(proto);	self->data = cpalloc(proto->data, sizeof(IoAudioMixerData));		DATA(self)->ioBuffer = IoSeq_new(IOSTATE);	DATA(self)->buffer = IoSeq_rawUArray(DATA(self)->ioBuffer);	DATA(proto)->mixBuffer = UArray_new();	DATA(self)->writeMessage = 		IoMessage_newWithName_label_(IOSTATE, 							    IOSYMBOL("write"), 							    IOSYMBOL("AudioMixer"));	IoMessage_setCachedArg_to_(DATA(self)->writeMessage, 0, DATA(self)->ioBuffer);		DATA(self)->nonBlockingWriteMessage = 		IoMessage_newWithName_label_(IOSTATE, 							    IOSYMBOL("nonBlockingWrite"), 							    IOSYMBOL("AudioMixer"));	IoMessage_setCachedArg_to_(DATA(self)->nonBlockingWriteMessage, 0, DATA(self)->ioBuffer);		DATA(self)->sounds = List_new();	DATA(self)->soundsToRemove = List_new();	DATA(self)->events = List_new();	DATA(self)->activeEvents = List_new();	DATA(self)->volume = DATA(self)->volume;		DATA(self)->soundTouch = SoundTouch_init();	SoundTouch_setSampleRate(DATA(self)->soundTouch, 44100);	SoundTouch_setChannels(DATA(self)->soundTouch, 2);	DATA(self)->tempo = 1.0;	IoState_addValue_(IOSTATE, self);	return self; }
开发者ID:ADTSH,项目名称:io,代码行数:33,


示例2: s16_svc_new

svc_t * s16_svc_new (){    svc_t * newSvc = calloc (1, sizeof (svc_t));    newSvc->properties = List_new ();    newSvc->instances = List_new ();    return newSvc;}
开发者ID:Prospero86,项目名称:ServiceManager,代码行数:7,


示例3: Post_new

Post_t Post_new(int xCoord, int yCoord){    Post_t self = (Post_t) malloc(sizeof(struct Post));    self->wantedCars = List_new();    self->wantedCarEvents = List_new();    self->transists = List_new();    self->xCoord = xCoord;    self->yCoord = yCoord;    return self;}
开发者ID:Silchenko-Nikita,项目名称:Silchenko-Nikita-s,代码行数:9,


示例4: ASSERT

// Creates a new RULE CONDITION GRAPH - it creates a RCG node for every tuple variable// Takes the tuple variable and the data source list along with the number of tuple variables// as the inputRCG *RCG_new(int num_tuple_var, List *tuple_var_list, List *datasrc_list){	RCG *graph;	int i;	ListElement *cursor1, *cursor2;	RCG_node *node;	void *tuple_var_name, *datasrc_name;	ASSERT(tuple_var_list);	ASSERT(datasrc_list);    	graph = (RCG *)tman_malloc(sizeof(RCG));		memset(graph, '/0', sizeof(RCG));	graph->type = RCG_TYPE;		graph->num_tuple_variables = num_tuple_var;	graph->nodes = List_new();	graph->catch_all = List_new();		if (!num_tuple_var)	{		/* The RCG does not have any tuple variables. For ex.		** when 1 = 1.		*/		return graph;	}	/* create the individual nodes -- one for each tuple variable*/	node = RCG_node_new();	tuple_var_name = (char *)List_getFirst(tuple_var_list, &cursor1);   	datasrc_name = (char *)List_getFirst(datasrc_list, &cursor2);	node->tuple_variable_name = get_chars(tuple_var_name);    node->datasrc_name = get_chars(datasrc_name);    /* Insert the node into the RCG */	List_insertElement(graph->nodes, node);		for (i = 1; i < num_tuple_var; i++)	{		/* create the individual nodes */		node = RCG_node_new();		tuple_var_name = (char *)List_getNext(&cursor1);   		datasrc_name = (char *)List_getNext(&cursor2);		node->tuple_variable_name = get_chars(tuple_var_name);        node->datasrc_name = get_chars(datasrc_name);		/* Insert the node into the RCG */		List_insertElement(graph->nodes, node);	}    return graph;}
开发者ID:aevernon,项目名称:triggerman,代码行数:59,


示例5: sizeof

IoLexer *IoLexer_new(void){	IoLexer *self = (IoLexer *)io_calloc(1, sizeof(IoLexer));	self->s = (char *)io_calloc(1, 1);	self->s[0] = 0;	self->posStack = Stack_new();	self->tokenStack = Stack_new();	self->tokenStream = List_new();	self->charLineIndex = List_new();	return self;}
开发者ID:Akiyah,项目名称:io,代码行数:11,


示例6: IoObject_rawClonePrimitive

IoODEWorld *IoODEWorld_rawClone(IoODEWorld *proto){	IoObject *self = IoObject_rawClonePrimitive(proto);	IoObject_setDataPointer_(self, calloc(1, sizeof(IoODEWorldData)));	WORLDID = dWorldCreate();	DATA(self)->bodies = List_new();	DATA(self)->jointGroups = List_new();	IoObject_inlineSetSlot_to_(self, IOSYMBOL("Body"), IoODEBody_newBodyProtoWithWorld(IOSTATE, self));	IoObject_inlineSetSlot_to_(self, IOSYMBOL("JointGroup"), IoODEJointGroup_newJointGroupProtoWithWorld(IOSTATE, self));	return self;}
开发者ID:ADTSH,项目名称:io,代码行数:11,


示例7: Command_new

T Command_new(const char *path, const char *arg0, ...) {        T C;        if (! File_exist(path))                THROW(AssertException, "File '%s' does not exist", path ? path : "null");        NEW(C);        C->env = List_new();        C->args = List_new();        List_append(C->env, Str_dup(Command_Path));        va_list ap;        va_start(ap, arg0);        buildArgs(C, path, arg0, ap);        va_end(ap);        return C;}
开发者ID:cention-nazri,项目名称:monit-5.5,代码行数:14,


示例8: main

int main(int argc, char **argv){  List_t l = List_new();  fprintf(stdout, "test List.../n");  int i;  for (i = 0; i < 100; i++) {    List_addFirst(l, i);  }  fprintf(stdout, "List_getFirst/n");  int r = (int) List_getFirst(l);  assert(r == 99);  fprintf(stdout, "List_getIndexOf/n");  for (i = 0; i < 100; i++) {    r = (int) List_getIndexOf(l, i);    assert(r == (99 - i));  }  fprintf(stdout, "List_addLast/n");  List_addLast(l, 200);  r = (int) List_getIndexOf(l, 100);  assert(r == 200);  fprintf(stdout, "List_size/n");  r = List_size(l);  assert(r == 101);  fprintf(stdout, "List_isEmpty/n");  r = List_isEmpty(l);  assert(r == 0);  List_t l2 = List_new();  r = List_isEmpty(l2);  assert(r == 1);  fprintf(stdout, "List_remove/n");  for (i = 0; i < 100; i++) {    r = (int) List_removeFirst(l);    assert(r == (99 - i));  }  r = (int) List_removeFirst(l);  assert(r == 200);  r = List_isEmpty(l);  assert(r == 1);  return 0;}
开发者ID:qc1iu,项目名称:c-lib,代码行数:49,


示例9: RCG_node_new

RCG_node * RCG_node_new(void){	RCG_node *node;	node = (RCG_node *) tman_malloc(sizeof(RCG_node));	memset(node, '/0', sizeof(RCG_node));	node->selection_predicates_list = List_new();	node->join_predicates_list = List_new();	node->already_inserted = 0;	node->decorated_selection_predicate = NULL;    node->type = RCG_NODE_TYPE;	return node;}
开发者ID:aevernon,项目名称:triggerman,代码行数:15,


示例10: Context_intersect_clip_rect

//Update the clipping rectangles to only include those areas within both the//existing clipping region AND the passed Rectvoid Context_intersect_clip_rect(Context* context, Rect* rect) {    int i;    List* output_rects;    Rect* current_rect;    Rect* intersect_rect;     context->clipping_on = 1;    if(!(output_rects = List_new()))        return;    for(i = 0; i < context->clip_rects->count; i++) {        current_rect = (Rect*)List_get_at(context->clip_rects, i);        intersect_rect = Rect_intersect(current_rect, rect);        if(intersect_rect)            List_add(output_rects, (Object*)intersect_rect);    }    //Delete the original rectangle list    Object_delete((Object*)context->clip_rects);    //And re-point it to the new one we built above    context->clip_rects = output_rects;    //Free the input rect    Object_delete((Object*)rect);}
开发者ID:JMarlin,项目名称:P5-Redux,代码行数:32,


示例11: adminInterfaces

static void adminInterfaces(Dict* args,                            void* vcontext,                            String* txid,                            struct Allocator* alloc){    struct Context* context = Identity_check((struct Context*)vcontext);    int64_t* page = Dict_getIntC(args, "page");    int i = (page) ? *page * ENTRIES_PER_PAGE : 0;    int count = InterfaceController_ifaceCount(context->ic);    //int count = InterfaceController_getIface(context->ic, alloc, &stats);    List* list = List_new(alloc);    for (int counter = 0; i < count && counter++ < ENTRIES_PER_PAGE; i++) {        struct InterfaceController_Iface* iface = InterfaceController_getIface(context->ic, i);        Dict* d = Dict_new(alloc);        Dict_putIntC(d, "ifNum", iface->ifNum, alloc);        Dict_putStringC(d, "name", iface->name, alloc);        char* bs = InterfaceController_beaconStateString(iface->beaconState);        Dict_putStringCC(d, "beaconState", bs, alloc);        List_addDict(list, d, alloc);    }    Dict* resp = Dict_new(alloc);    Dict_putListC(resp, "ifaces", list, alloc);    Dict_putIntC(resp, "total", count, alloc);    if (i < count) { Dict_putIntC(resp, "more", 1, alloc); }    Admin_sendMessage(resp, txid, context->admin);}
开发者ID:cjdelisle,项目名称:cjdns,代码行数:30,


示例12: searchResponse

static void searchResponse(struct RouterModule_Promise* promise,                           uint32_t lag,                           struct Address* from,                           Dict* responseDict){    struct Search* search = Identity_check((struct Search*) promise->userData);    struct Allocator* alloc = Allocator_child(search->alloc);    Dict* resp = Dict_new(alloc);    if (!from) {        Dict_putStringCC(resp, "error", "none", alloc);        Dict_putIntC(resp, "complete", 1, alloc);        Admin_sendMessage(resp, search->txid, search->ctx->admin);        Allocator_free(alloc);        return;    }    String* fromStr = Address_toString(from, alloc);    Dict_putStringC(resp, "from", fromStr, alloc);    Dict_putIntC(resp, "ms", lag, alloc);    struct Address_List* addrs = ReplySerializer_parse(from, responseDict, NULL, true, alloc);    List* nodes = List_new(alloc);    for (int i = 0; addrs && i < addrs->length; i++) {        String* addr = Address_toString(&addrs->elems[i], alloc);        List_addString(nodes, addr, alloc);    }    Dict_putListC(resp, "nodes", nodes, alloc);    Admin_sendMessage(resp, search->txid, search->ctx->admin);}
开发者ID:DmytroOrlov,项目名称:cjdns,代码行数:32,


示例13: io_calloc

Levels *Levels_new(IoMessage *msg){	Levels *self = io_calloc(1, sizeof(Levels));	IoState *state = IoObject_state(msg);	IoSymbol *operatorTableSymbol = IoState_symbolWithCString_(state, "OperatorTable");	// Be ultra flexable, and try to use the first message's operator table.	IoObject *opTable = IoObject_rawGetSlot_(msg, operatorTableSymbol);	// Otherwise, use Core OperatorTable, and if that doesn't exist, create it.	if (opTable == NULL)	{		// There is a chance the message didn't have it, but the core did---due		// to the Core not being part of the message's protos. Use Core		// Message's OperatorTable		opTable = IoObject_rawGetSlot_(state->core, operatorTableSymbol);		// If Core doesn't have an OperatorTable, then create it.		if (opTable == NULL)		{			opTable = IoObject_new(state);			IoObject_setSlot_to_(state->core, operatorTableSymbol, opTable);			IoObject_setSlot_to_(opTable, IoState_symbolWithCString_(state, "precedenceLevelCount"), IoState_numberWithDouble_(state, IO_OP_MAX_LEVEL));		}	}	self->operatorTable = getOpTable(opTable, "operators", IoState_createOperatorTable);	self->assignOperatorTable = getOpTable(opTable, "assignOperators", IoState_createAssignOperatorTable);	self->stack = List_new();	Levels_reset(self);	return self;}
开发者ID:cdcarter,项目名称:io,代码行数:34,


示例14: Section_new

Section* Section_new(double x, double y, double z,	double width, double height, double length, int enemies) {	Section* inst = (Section*) malloc(sizeof(Section));	int i;	Vector spawn;	double spacing;	inst->pos[0] = x, inst->pos[1] = y, inst->pos[2] = z;	inst->size[0] = width, inst->size[1] = height, inst->size[2] = length;	inst->entities = List_new();	for(i = 0, spacing = 0; i < enemies; ++i) {		spawn[0] = randomInterval(x, x + width - Enemy_DEF_SIZE[0]);		spawn[1] = randomInterval(y, y + height - Enemy_DEF_SIZE[1]);		spawn[2] = randomInterval(z + spacing, z + length);		List_pushBack(inst->entities, Enemy_new(			spawn[0], spawn[1], spawn[2], random(),			random() * 5 + 1, 800));		spacing += Enemy_DEF_SIZE[2] + length/enemies;	}	return inst;}
开发者ID:yancouto,项目名称:LabProgGame,代码行数:25,


示例15: Levels_new

IoMessage *IoMessage_opShuffle(IoMessage *self, IoObject *locals, IoMessage *m){	Levels *levels = Levels_new(self);	List *expressions = List_new();	List_push_(expressions, self);	while (List_size(expressions) >= 1)	{		IoMessage *n = List_pop(expressions);		do		{			Levels_attach(levels, n, expressions);			List_appendSeq_(expressions, DATA(n)->args);		} while ((n = DATA(n)->next));		Levels_nextMessage(levels);	}	List_free(expressions);	Levels_free(levels);	return self;}
开发者ID:ADTSH,项目名称:io,代码行数:25,


示例16: Context_new

//Constructor for our contextContext* Context_new(uint16_t width, uint16_t height, uint32_t* buffer) {    static unsigned int handle_source = 0;    //Attempt to allocate    Context* context;    if(!(context = (Context*)malloc(sizeof(Context))))        return context;     //Init base object    Object_init((Object*)context, Context_delete_function);    //Attempt to allocate new rect list     if(!(context->clip_rects = List_new())) {        free(context);        return (Context*)0;    }    //Finish assignments    context->id = ++handle_source;    context->translate_x = 0;    context->translate_y = 0;    context->width = width;     context->height = height;     context->buffer = buffer;    context->clipping_on = 0;    context->finalize_handler = (ContextFinalizeHandler)0;    return context;}
开发者ID:JMarlin,项目名称:P5-Redux,代码行数:32,


示例17: getHandles

static void getHandles(Dict* args, void* vcontext, String* txid, struct Allocator* requestAlloc){    struct Context* context = Identity_check((struct Context*) vcontext);    struct Allocator* alloc = Allocator_child(context->alloc);    int64_t* page = Dict_getInt(args, String_CONST("page"));    int i = (page) ? *page * ENTRIES_PER_PAGE : 0;    struct SessionManager_HandleList* hList = SessionManager_getHandleList(context->sm, alloc);    List* list = List_new(alloc);    for (int counter = 0; i < hList->length && counter++ < ENTRIES_PER_PAGE; i++) {        List_addInt(list, hList->handles[i], alloc);    }    Dict* r = Dict_new(alloc);    Dict_putList(r, String_CONST("handles"), list, alloc);    Dict_putInt(r, String_CONST("total"), hList->length, alloc);    String* more = String_CONST("more");    if (i < hList->length) {        Dict_putInt(r, more, 1, alloc);    }    Admin_sendMessage(r, txid, context->admin);    Allocator_free(alloc);}
开发者ID:FSFTN,项目名称:cjdns,代码行数:27,


示例18: Trace_addFunc

void Trace_addFunc(char *s){    if (!traceList)        traceList = List_new();    List_addFirst(traceList, s);}
开发者ID:qc1iu,项目名称:turkeyVM,代码行数:7,


示例19: dumpRumorMill

static void dumpRumorMill(Dict* args, void* vcontext, String* txid, struct Allocator* requestAlloc){    struct Context* ctx = Identity_check((struct Context*) vcontext);    Dict* out = Dict_new(requestAlloc);    struct RumorMill* rm = getRumorMill(ctx, Dict_getString(args, String_CONST("mill")));    if (!rm) {        Dict_putString(out,                       String_CONST("error"),                       String_CONST("mill must be one of "                                    "[externalMill,linkMill,nodeMill,dhtMill,splitMill]"),                       requestAlloc);        Admin_sendMessage(out, txid, ctx->admin);        return;    }    int64_t* page = Dict_getInt(args, String_CONST("page"));    int ctr = (page) ? *page * ENTRIES_PER_PAGE : 0;    List* table = List_new(requestAlloc);    for (int i = 0; i < ENTRIES_PER_PAGE && ctr < rm->count; i++) {        String* addr = Address_toString(&rm->addresses[ctr++], requestAlloc);        List_addString(table, addr, requestAlloc);    }    Dict_putList(out, String_CONST("addresses"), table, requestAlloc);    Dict_putInt(out, String_CONST("total"), rm->count, requestAlloc);    Admin_sendMessage(out, txid, ctx->admin);}
开发者ID:BurnBeforeReading,项目名称:cjdns,代码行数:28,


示例20: genericResponse

static void genericResponse(struct RouterModule_Promise* promise,                            uint32_t lag,                            struct Address* from,                            Dict* responseDict,                            String* name){    struct Ping* ping = Identity_check((struct Ping*)promise->userData);    Dict* out = Dict_new(promise->alloc);    String* result = (responseDict) ? name : String_CONST("timeout");    Dict_putString(out, String_CONST("result"), result, promise->alloc);    if (responseDict) {        struct Address_List* addrs =            ReplySerializer_parse(from, responseDict, NULL, promise->alloc);        List* nodes = List_new(promise->alloc);        for (int i = 0; i < addrs->length; i++) {            String* addr = Address_toString(&addrs->elems[i], promise->alloc);            List_addString(nodes, addr, promise->alloc);        }        Dict_putList(out, name, nodes, promise->alloc);    }    Dict_putInt(out, String_CONST("ms"), lag, promise->alloc);    Dict_putString(out, String_CONST("error"), String_CONST("none"), promise->alloc);    Admin_sendMessage(out, ping->txid, ping->ctx->admin);}
开发者ID:0x20c24,项目名称:cjdns,代码行数:29,


示例21: getSomething

static void getSomething(Dict* args,                         struct RouteGen_admin_Ctx* ctx,                         String* txid,                         struct Allocator* requestAlloc,                         Dict* genRoutes){    int page = getIntVal(args, String_CONST("page"));    List* routes;    if (getIntVal(args, String_CONST("ip6"))) {        routes = Dict_getList(genRoutes, String_CONST("ipv6"));    } else {        routes = Dict_getList(genRoutes, String_CONST("ipv4"));    }    Assert_true(routes);    List* outList = List_new(requestAlloc);    bool more = false;    for (int i = page * ROUTES_PER_PAGE, j = 0; i < List_size(routes) && j < ROUTES_PER_PAGE; j++) {        String* route = List_getString(routes, i);        Assert_true(route);        List_addString(outList, route, requestAlloc);        if (++i >= List_size(routes)) {            more = false;            break;        }        more = true;    }    Dict* out = Dict_new(requestAlloc);    if (more) {        Dict_putInt(out, String_new("more", requestAlloc), 1, requestAlloc);    }    Dict_putList(out, String_new("routes", requestAlloc), outList, requestAlloc);    Admin_sendMessage(out, txid, ctx->admin);}
开发者ID:interfect,项目名称:cjdns,代码行数:33,


示例22: RETURN_NULL_IF_OVER_DEPTH_LIMIT

// phrase_word_list -> word+static syntree *phrase_word_list (token ** lookahead, err_context context){	syntree *left = NULL;	List *word_list = NULL;	RETURN_NULL_IF_OVER_DEPTH_LIMIT(context);	// It has already been tested that the lookahead is a word node.	left = (syntree *) ft_word_new ((*lookahead)->lexeme->contents);	advance (lookahead);	// If more than one word is present, form the list of all the words and 	// make a phrase.	if (ft_test (lookahead, TOK_FT_WORD))	{		int num_words = 0;		word_list = List_new ();		// Add the word already parsed.		List_insertElement (word_list, left);		num_words++;		// Add subsequent words.		do		{			left = (syntree *) ft_word_new ((*lookahead)->lexeme->contents);			List_insertElement (word_list, left);			num_words++;			advance (lookahead);		} while (ft_test(lookahead, TOK_FT_WORD));		return ((syntree *)ft_phrase_new (word_list, num_words));	}	// Otherwise return a word node.	return (left);}
开发者ID:aevernon,项目名称:triggerman,代码行数:35,


示例23: pt_new

process_tracker_t * pt_new (int kq){    process_tracker_t * pt = s16mem_alloc (sizeof (process_tracker_t));    pt->kq = kq;    pt->pids = List_new ();    return pt;}
开发者ID:Roghetti,项目名称:ServiceManager,代码行数:7,


示例24: List_new

void *Datum_split_(Datum *self, void *delimsList) /* returns a List */{	List *delims = (List *)delimsList;	List *results = List_new();	size_t i, last = 0;		for (i = 0; i < self->size; i ++)	{		Datum d = Datum_datumAt_(self, i);		size_t j; 				for (j = 0; j < (size_t)List_size(delims); j ++)		{			Datum *delim = (Datum *)List_at_(delims, j);						if (Datum_beginsWith_(&d, delim))			{                                List_append_(results, Datum_newFrom_to_(self, last, i));								last = i + delim->size;				i = last - 1; /* since for() will increment it */				break;			}		}	}		if (last != self->size)	{		List_append_(results, Datum_newFrom_to_(self, last, self->size));	}		return results;}
开发者ID:IceAssassin,项目名称:skipdbv2,代码行数:33,


示例25: List_append

List_errno_t List_append(ListPtr l, const ListElPtr el){  ListPtr it = l;  if (l == NULL) {    return LIST_NULL;  }  if (l->node == NULL) {    l->node = ListEl_new();    ListEl_copy(l->node, el);  }  while(it->next != NIL)  {    it = it->next;  }    it->next = List_new();   if (it->next == NIL) {    return LIST_MEMALLOC_ERR;  }  it = it->next;  it->node = ListEl_new();  if (it->node == NULL) {    return LIST_MEMALLOC_ERR;  }  return ListEl_copy(it->node, el);}
开发者ID:sduc,项目名称:cfunctional,代码行数:31,


示例26: Datum_find_

long Datum_find_(Datum *self, void *delimsList, size_t startIndex) {	List *delims = (List *)delimsList;	List *results = List_new();	size_t i, last = 0;		if (startIndex > self->size) return -1;		for (i = startIndex; i < self->size; i ++)	{		Datum d = Datum_datumAt_(self, i);		size_t j; 				for (j = 0; j < (size_t)List_size(delims); j ++)		{			Datum *delim = (Datum *)List_at_(delims, j);						if (Datum_beginsWith_(&d, delim))			{				return i;			}		}	}		return -1;}
开发者ID:IceAssassin,项目名称:skipdbv2,代码行数:26,


示例27: sizeof

Collector *Collector_new(void){	Collector *self = (Collector *)io_calloc(1, sizeof(Collector));	self->retainedValues = List_new();	self->whites = CollectorMarker_new();	self->grays  = CollectorMarker_new();	self->blacks = CollectorMarker_new();	self->freed = CollectorMarker_new();	CollectorMarker_loop(self->whites);	CollectorMarker_removeIfNeededAndInsertAfter_(self->grays, self->whites);	CollectorMarker_removeIfNeededAndInsertAfter_(self->blacks, self->grays);	CollectorMarker_removeIfNeededAndInsertAfter_(self->freed, self->blacks);	// important to set colors *after* inserts, since inserts set colors	CollectorMarker_setColor_(self->whites, COLLECTOR_INITIAL_WHITE);	CollectorMarker_setColor_(self->blacks, COLLECTOR_INITIAL_BLACK);	CollectorMarker_setColor_(self->grays,  COLLECTOR_GRAY);	CollectorMarker_setColor_(self->freed,  COLLECTOR_FREE);		Collector_setSafeModeOn_(self, 1);	self->allocated = 0;	self->allocatedSweepLevel = 3000;	self->allocatedStep = 1.1f;	self->marksPerAlloc = 2;	self->clocksUsed = 0;	Collector_check(self);	return self;}
开发者ID:doublec,项目名称:io,代码行数:35,


示例28: sizeof

UDBIndex *UDBIndex_new(void){	UDBIndex *self = (UDBIndex *)calloc(1, sizeof(UDBIndex));	self->file = JFile_new();	UDBIndex_setPath_(self, "default");	self->holes = List_new();	return self;}
开发者ID:IceAssassin,项目名称:skipdbv2,代码行数:8,


示例29: List_copy

List List_copy(List list){	List listCopy = List_new();	void* ptr;	int i;	List_foreach(list, ptr, i){		List_insert(listCopy,ptr);	}
开发者ID:stevenlr,项目名称:GrandPrix,代码行数:8,


示例30: Person_newlist

List * Person_newlist() {    List *l = List_new(        (int (*)(void *, void *))Person_cmp,        (void (*)(void *))Person_print,        (bool (*)(void *, void *))Person_query        );    return l;}
开发者ID:josmardias,项目名称:linkedlist,代码行数:8,



注:本文中的List_new函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ List_push函数代码示例
C++ List_create函数代码示例
51自学网自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1