Open Woazboat opened 1 year ago
Okay, seems like this is more of an issue with (outdated?) documentation. eastl::fixed_allocator
takes a name string as the first argument and therefore works properly. eastl::fixed_pool
and eastl::fixed_node_allocator
are in the internal folder, so I guess they don't need to conform to the convention.
The documentation here should be changed to use eastl::fixed_allocator
instead of eastl::fixed_pool
.
When using a standard non-fixed container (e.g. list, map, etc...) with a fixed allocator like
eastl::fixed_pool
oreastl::fixed_node_allocator
, the default container constructor (/the default parameter for the allocator) attempts to construct the allocator using the container name string as the first parameter.e.g. for
map
:The fixed allocator constructors are declared as:
This breaks and fails to compile when a fixed allocator is used for a default constructed container since the fixed allocators do not use the name as the first constructor parameter. (Actually it attempts to use the
const char*
string as thevoid*
memory buffer argument and the only reason it fails to compile is because it expects a non-const
pointer, otherwise it would silently accept it which might be even worse.)The example that's given in the documentation does not actually work due to this issue. https://eastl.docsforge.com/master/faq/#cont10-how-do-i-use-a-memory-pool-with-a-container