(isScoped, list)
| 8444 | |
| 8445 | // impl for allocMainArgv() and scopedAllocMainArgv(). |
| 8446 | const __allocMainArgv = function(isScoped, list){ |
| 8447 | const pList = target[ |
| 8448 | isScoped ? 'scopedAlloc' : 'alloc' |
| 8449 | ]((list.length + 1) * target.ptr.size); |
| 8450 | let i = 0; |
| 8451 | list.forEach((e)=>{ |
| 8452 | target.pokePtr(__ptrAdd(pList, target.ptr.size * i++), |
| 8453 | target[ |
| 8454 | isScoped ? 'scopedAllocCString' : 'allocCString' |
| 8455 | ](""+e)); |
| 8456 | }); |
| 8457 | target.pokePtr(__ptrAdd(pList, target.ptr.size * i), 0); |
| 8458 | return pList; |
| 8459 | }; |
| 8460 | |
| 8461 | /** |
| 8462 | Creates an array, using scopedAlloc(), suitable for passing to a |
no test coverage detected