Skip to content

alloc: don't overwrite allocator during init if set#4724

Merged
carlosmn merged 1 commit intomasterfrom
cmn/allocator-init-order
Jul 15, 2018
Merged

alloc: don't overwrite allocator during init if set#4724
carlosmn merged 1 commit intomasterfrom
cmn/allocator-init-order

Conversation

@carlosmn
Copy link
Copy Markdown
Member

If the allocator has been set before we the library is initialised, we would
replace that setting with the standard allocator contrary to the user's wishes.


In the general case the only safe time to set the allocator is before initialising the library as we allocate things there. Did we decide otherwise or this just oversight?

Annoyingly this will work if we init and then set the allocator in CI because by default ruby is built with the standard allocator, but it's not uncommon to have a tcmalloc-using MRI in production which would be upset if we mix allocators.

If the allocator has been set before we the library is initialised, we would
replace that setting with the standard allocator contrary to the user's wishes.
@ethomson
Copy link
Copy Markdown
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants