GUDHI / gudhi-devel

The GUDHI library is a generic open source C++ library, with a Python interface, for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.
https://gudhi.inria.fr/
MIT License
245 stars 65 forks source link

default_user_allocator_malloc_free in Simple_object_pool #1100

Open mglisse opened 2 days ago

mglisse commented 2 days ago

https://github.com/GUDHI/gudhi-devel/blob/1d4421cca1dbb3c290f3b72c2546a30917edfbf7/src/common/include/gudhi/Simple_object_pool.h#L26

In Simple_object_pool, I specified default_user_allocator_malloc_free because it was slightly faster than the default. Now that we are increasing its use, I am worried that this choice may cause problems, and we should investigate what happens for out-of-memory. Supposedly, the default is based on new/delete and should throw an exception, whereas the malloc version may crash. In that case, it may be safer (particularly for the Python module) to go back to the default.

Other things to look at around there: