| 56 | } |
| 57 | |
| 58 | void table_clear ( Context & context, Table & arr, LineInfo * at ) { |
| 59 | if ( arr.isLocked() ) context.throw_error_at(at, "can't clear locked table"); |
| 60 | if ( arr.data ) { |
| 61 | memset(arr.hashes, 0, arr.capacity*tableHashSlotBytes(arr)); |
| 62 | memset(arr.data, 0, arr.keys - arr.data); |
| 63 | } |
| 64 | arr.size = 0; |
| 65 | arr.tombstones = 0; |
| 66 | } |
| 67 | |
| 68 | void table_lock ( Context & context, Table & arr, LineInfo * at ) { |
| 69 | if ( arr.shared || arr.hopeless ) return; |
no test coverage detected