Retrieve the type of an array element, or TypeCode::None if the index is out of range Caller must have a read lock on heapLock before calling this!
| 150 | // Retrieve the type of an array element, or TypeCode::None if the index is out of range |
| 151 | // Caller must have a read lock on heapLock before calling this! |
| 152 | TypeCode ArrayHandle::GetElementType(size_t index) const noexcept |
| 153 | { |
| 154 | #if CHECK_HEAP_LOCKED |
| 155 | Heap::heapLock.CheckHasReadOrWriteLock(); |
| 156 | #endif |
| 157 | if (slotPtr != nullptr) |
| 158 | { |
| 159 | #if CHECK_HANDLES |
| 160 | Heap::CheckSlotGood(slotPtr); |
| 161 | #endif |
| 162 | ArrayStorageSpace * const aSpace = reinterpret_cast<ArrayStorageSpace*>(_ecv_not_null(slotPtr->storage)); |
| 163 | if (index < aSpace->count) |
| 164 | { |
| 165 | return aSpace->elements[index].GetType(); |
| 166 | } |
| 167 | } |
| 168 | return TypeCode::None; |
| 169 | } |
| 170 | |
| 171 | // Decrease the reference count for the array referred to and delete it if it reaches zero |
| 172 | void ArrayHandle::Delete() noexcept |
no test coverage detected