Skip to content

Conversation

@Sonicadvance1
Copy link
Member

These need to be late initialized because they allocate memory and register an atexit handler to deallocate.
Leave the deallocation for our Shutdown handler.

Removes an atexit registration that contributes to crashing on exit.

}

void Initialize() {
Paths = new (PathsPlacement) PathsType {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need placement new here instead of plain new?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plain new causes glibc allocation to occur, and this also gives a nicety of static allocation still.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Static allocation duration so we aren't mixing allocators.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would we be mixing allocators if we just used FEXCore::Allocator instead?

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.
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