The Geogram aligned allocator does not fulfill this contract; if it cannot allocate, aligned_malloc will return 0, and this will be returned by the allocator, causing a segfault.
This could be fixed by having the allocate() method check for nullptr and throw std::bad_alloc if it is; that way, the contract will be fulfilled, and an out-of-memory will throw an exception that can be caught higher up.
If the system does not have enough memory to allocate a GEO::vector, it will segfault. The reason for this is that GEO::vector is essentially an std::vector that uses the Geogram aligned allocator, and the contract for allocators for STL container classes requires that if they return (i.e. do not throw) they return a valid block of memory (https://stackoverflow.com/questions/4826838/do-standard-library-stl-containers-support-a-form-of-nothrow-allocation).
The Geogram aligned allocator does not fulfill this contract; if it cannot allocate, aligned_malloc will return 0, and this will be returned by the allocator, causing a segfault.
This could be fixed by having the allocate() method check for nullptr and throw std::bad_alloc if it is; that way, the contract will be fulfilled, and an out-of-memory will throw an exception that can be caught higher up.