MCPcopy Create free account
hub / github.com/Tencent/libco / co_alloc_stackmem

Function co_alloc_stackmem

co_routine.cpp:269–277  ·  view source on GitHub ↗

////////////for copy stack //////////////////////////

Source from the content-addressed store, hash-verified

267
268/////////////////for copy stack //////////////////////////
269stStackMem_t* co_alloc_stackmem(unsigned int stack_size)
270{
271 stStackMem_t* stack_mem = (stStackMem_t*)malloc(sizeof(stStackMem_t));
272 stack_mem->occupy_co= NULL;
273 stack_mem->stack_size = stack_size;
274 stack_mem->stack_buffer = (char*)malloc(stack_size);
275 stack_mem->stack_bp = stack_mem->stack_buffer + stack_size;
276 return stack_mem;
277}
278
279stShareStack_t* co_alloc_sharestack(int count, int stack_size)
280{

Callers 2

co_alloc_sharestackFunction · 0.85
co_create_envFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected