Skip to content

FEXCore/Allocator: Make pmr::default_resource a late initialized static object#5212

Open
Sonicadvance1 wants to merge 1 commit intoFEX-Emu:mainfrom
Sonicadvance1:47
Open

FEXCore/Allocator: Make pmr::default_resource a late initialized static object#5212
Sonicadvance1 wants to merge 1 commit intoFEX-Emu:mainfrom
Sonicadvance1:47

Conversation

@Sonicadvance1
Copy link
Copy Markdown
Member

Just a little bit of late initialization to this pmr object using placement new.

Removes an atexit registration that contributes to crashing on exit.

Comment thread FEXCore/Source/Utils/Allocator.cpp Outdated
static fextl::pmr::default_resource FEXDefaultResource;
static std::once_flag default_resource_initialized {};
static fextl::pmr::default_resource* FEXDefaultResource {};
alignas(alignof(fextl::pmr::default_resource)) static char FEXDefaultResourcePlacement[sizeof(fextl::pmr::default_resource)];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FTR same point as in the other related PRs applies here, pending discussion over there.

Copy link
Copy Markdown
Member

@neobrain neobrain left a comment

Choose a reason for hiding this comment

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

(highlighting pending discussions since our PR list is getting cluttered by stalled PRs)

…ic object

Just a little bit of late initialization to this pmr object using
placement new.

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