internal
| 873 | |
| 874 | // internal |
| 875 | void CScriptArray::CreateBuffer(SArrayBuffer** buf, std::uint32_t numElements) |
| 876 | { |
| 877 | *buf = static_cast<SArrayBuffer*>(asAllocMem(sizeof(SArrayBuffer) - 1 + elementSize * numElements)); |
| 878 | |
| 879 | if ((*buf) != nullptr) { |
| 880 | (*buf)->numElements = numElements; |
| 881 | (*buf)->maxElements = numElements; |
| 882 | Construct(*buf, 0, numElements); |
| 883 | } else { |
| 884 | // Oops, out of memory |
| 885 | asIScriptContext* ctx = asGetActiveContext(); |
| 886 | if (ctx != nullptr) { |
| 887 | ctx->SetException("Out of memory"); |
| 888 | } |
| 889 | } |
| 890 | } |
| 891 | |
| 892 | // internal |
| 893 | void CScriptArray::DeleteBuffer(SArrayBuffer* buf) |
nothing calls this directly
no test coverage detected