MCPcopy Create free account
hub / github.com/F-Stack/f-stack / AllocItem

Method AllocItem

adapter/micro_thread/mt_net.h:68–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 };
67
68 Type* AllocItem() {
69 Type* item = TAILQ_FIRST(&_free_list);
70 if (item != NULL)
71 {
72 TAILQ_REMOVE(&_free_list, item, _link_entry);
73 _count--;
74 return item;
75 }
76
77 item = new Type();
78 if (NULL == item)
79 {
80 return NULL;
81 }
82
83 return item;
84 };
85
86 void FreeItem(Type* obj) {
87 //obj->Reset();

Callers 3

AllocNetItemMethod · 0.80
AllocSockLinkMethod · 0.80
AllocDestLinkMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected