Support disabling the Erlang allocator - #357
Conversation
| sqlite3_config(SQLITE_CONFIG_GETMALLOC, &default_alloc_methods); | ||
| if (erlang_allocator_enabled) { | ||
| sqlite3_config(SQLITE_CONFIG_MALLOC, &methods); | ||
| } |
There was a problem hiding this comment.
It seemed simpler to me to unconditionally load and restore the default allocator and only conditionally override the default allocator with the Erlang ones to reduce the amount of branching that needs to happen.
|
@warmwaffles I'm a little unsure about the testing story here because it doesn't seem like the existing allocator is tested currently. Adding the |
Allow disabling the Erlang allocator which can sometimes have worse performance characteristics compared to the default one as demonstrated in #356.
In addition to the added automated tests, I manually tested this against the repro file provided in the issue by setting my fork as a dependency and toggling the
disable_erlang_allocatorsetting.