MCPcopy Create free account
hub / github.com/LAStools/LAStools / realloc_las

Function realloc_las

LASzip/src/mydefs.cpp:577–587  ·  view source on GitHub ↗

extension of the realloc function to check memory allocation errors

Source from the content-addressed store, hash-verified

575
576/// extension of the realloc function to check memory allocation errors
577void* realloc_las(void* ptr, size_t size) {
578 bool warning = check_available_RAM(size);
579
580 void* temp = realloc(ptr, size);
581 if (!temp && !warning) {
582 LASMessage(LAS_WARNING, "memory reallocation failed");
583 return ptr;
584 } else {
585 return temp;
586 }
587}
588
589/// extension of the malloc function to check memory allocation errors
590void* malloc_las(size_t size) {

Callers 15

mainFunction · 0.85
insertMethod · 0.85
mainFunction · 0.85
putByteMethod · 0.85
putBytesMethod · 0.85
readMethod · 0.85
laszip_read_headerFunction · 0.85
add_chunk_to_tableMethod · 0.85
manage_cellMethod · 0.85
add_attributeFunction · 0.85

Calls 2

check_available_RAMFunction · 0.85
LASMessageFunction · 0.85

Tested by 2

putByteMethod · 0.68
putBytesMethod · 0.68