| 44 | } |
| 45 | |
| 46 | void array_unlock ( Context & context, Array & arr, LineInfo * at ) { |
| 47 | if ( arr.shared || arr.hopeless ) return; |
| 48 | if ( arr.magic != DAS_ARRAY_MAGIC ) { |
| 49 | context.throw_error_at(at, "array magic mismatch on unlock, was it moved or overwritten?"); |
| 50 | } |
| 51 | if ( arr.lock==0 ) { |
| 52 | context.throw_error_at(at, "array lock underflow, was it moved or overwritten?"); |
| 53 | } |
| 54 | arr.lock --; |
| 55 | if ( arr.lock==0 ) { |
| 56 | arr.magic = 0; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | void array_reserve(Context & context, Array & arr, uint64_t newCapacity, uint32_t stride, LineInfo * at) { |
| 61 | if ( arr.isLocked() ) context.throw_error_at(at, "can't change capacity of a locked array"); |
no test coverage detected