FEXCore/Config: Late initialize two objects#5214
Open
Sonicadvance1 wants to merge 1 commit intoFEX-Emu:mainfrom
Open
FEXCore/Config: Late initialize two objects#5214Sonicadvance1 wants to merge 1 commit intoFEX-Emu:mainfrom
Sonicadvance1 wants to merge 1 commit intoFEX-Emu:mainfrom
Conversation
neobrain
reviewed
Jan 12, 2026
| } | ||
|
|
||
| void Initialize() { | ||
| Paths = new (PathsPlacement) PathsType {}; |
Member
There was a problem hiding this comment.
Why does it need placement new here instead of plain new?
Member
Author
There was a problem hiding this comment.
plain new causes glibc allocation to occur, and this also gives a nicety of static allocation still.
Member
There was a problem hiding this comment.
So we can just take FEXCore::Allocator or whatever it is that we normally use instead of new, right?
a nicety of static allocation still
Does this translate to any practical benefit? I'd rather we keep the code as complex as needed only if not.
Member
Author
There was a problem hiding this comment.
Yes. Static allocation duration so we aren't mixing allocators.
Member
There was a problem hiding this comment.
How would we be mixing allocators if we just used FEXCore::Allocator instead?
667b0af to
c1d83df
Compare
5896ac4 to
98e3c0f
Compare
These need to be late initialized because they allocate memory and register an `atexit` handler to deallocate. Removes an `atexit` registration that contributes to crashing on exit.
neobrain
requested changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These need to be late initialized because they allocate memory and register an
atexithandler to deallocate.Leave the deallocation for our Shutdown handler.
Removes an
atexitregistration that contributes to crashing on exit.