| 339 | } |
| 340 | |
| 341 | NULLCArray NULLC::AllocArray(unsigned size, unsigned count, unsigned type) |
| 342 | { |
| 343 | NULLCArray ret; |
| 344 | ret.len = 0; |
| 345 | ret.ptr = NULL; |
| 346 | if((unsigned long long)size * count > globalMemoryLimit) |
| 347 | { |
| 348 | nullcThrowError("ERROR: can't allocate array with %u elements of size %u", count, size); |
| 349 | return ret; |
| 350 | } |
| 351 | ret.len = 0; |
| 352 | ret.ptr = 4 + (char*)AllocObject(count * size + 4, type); |
| 353 | if(!(ret.ptr - 4)) |
| 354 | return ret; |
| 355 | ((unsigned*)ret.ptr)[-1] = count; |
| 356 | markerType *marker = (markerType*)((char*)ret.ptr - 4 - sizeof(markerType)); |
| 357 | *marker |= OBJECT_ARRAY; |
| 358 | ret.len = count; |
| 359 | return ret; |
| 360 | } |
| 361 | |
| 362 | void NULLC::MarkMemory(unsigned int number) |
| 363 | { |
nothing calls this directly
no test coverage detected