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

Function co_alloc_sharestack

co_routine.cpp:279–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279stShareStack_t* co_alloc_sharestack(int count, int stack_size)
280{
281 stShareStack_t* share_stack = (stShareStack_t*)malloc(sizeof(stShareStack_t));
282 share_stack->alloc_idx = 0;
283 share_stack->stack_size = stack_size;
284
285 //alloc stack array
286 share_stack->count = count;
287 stStackMem_t** stack_array = (stStackMem_t**)calloc(count, sizeof(stStackMem_t*));
288 for (int i = 0; i < count; i++)
289 {
290 stack_array[i] = co_alloc_stackmem(stack_size);
291 }
292 share_stack->stack_array = stack_array;
293 return share_stack;
294}
295
296static stStackMem_t* co_get_stackmem(stShareStack_t* share_stack)
297{

Callers 1

mainFunction · 0.85

Calls 1

co_alloc_stackmemFunction · 0.85

Tested by

no test coverage detected