| 277 | } |
| 278 | |
| 279 | stShareStack_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 | |
| 296 | static stStackMem_t* co_get_stackmem(stShareStack_t* share_stack) |
| 297 | { |
no test coverage detected