| 1671 | } |
| 1672 | |
| 1673 | void* fxNewGrowableChunk(txMachine* the, txSize size, txSize capacity) |
| 1674 | { |
| 1675 | #if mxNoChunks |
| 1676 | return fxNewChunk(the, size); |
| 1677 | #else |
| 1678 | txSize offset = size; |
| 1679 | txChunk* chunk; |
| 1680 | txBoolean once = 1; |
| 1681 | size = fxAdjustChunkSize(the, size); |
| 1682 | capacity = fxAdjustChunkSize(the, capacity); |
| 1683 | chunk = fxFindChunk(the, capacity, &once); |
| 1684 | if (!chunk) { |
| 1685 | chunk = fxGrowChunk(the, capacity); |
| 1686 | if (!chunk) { |
| 1687 | chunk = fxFindChunk(the, size, &once); |
| 1688 | if (!chunk) { |
| 1689 | chunk = fxGrowChunk(the, size); |
| 1690 | } |
| 1691 | } |
| 1692 | } |
| 1693 | #ifdef mxMetering |
| 1694 | the->meterIndex += size * XS_CHUNK_ALLOCATION_METERING; |
| 1695 | #endif |
| 1696 | return fxCheckChunk(the, chunk, size, offset); |
| 1697 | #endif |
| 1698 | } |
| 1699 | |
| 1700 | txSlot* fxNewSlot(txMachine* the) |
| 1701 | { |
no test coverage detected