Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify PoolAlloc by using thread_local #3267

Merged

Conversation

arcady-lunarg
Copy link
Contributor

@arcady-lunarg arcady-lunarg commented Jul 19, 2023

This is largely a revert of the revert of #2348, which was reverted due to not working on iOS 8.

C++11 supports thread_local storage class, which means we can drop the use of OS-bespoke OS_*TLSIndex functions.

This greatly simplifies fixing #2346.

Fixes #1429

ben-clayton and others added 3 commits July 19, 2023 12:03
glslang is using C++ 11, which has first class support for variables of the `thread_local` storage class.

By dropping the use of the `OS_[GS]etTLSValue`, we can simplify the logic, and have it support a thread-local default allocator if none is provided.

Issue: KhronosGroup#2346
These were only used for TThreadPool, which now uses `thread_local`.
These are no longer used now that the PoolAllocator uses the standard
c++11 thread_local storage mechanism.
@arcady-lunarg arcady-lunarg added the kokoro:run Trigger Google bot runs label Jul 19, 2023
@arcady-lunarg arcady-lunarg added kokoro:run Trigger Google bot runs and removed kokoro:run Trigger Google bot runs labels Jul 20, 2023
@kokoro-team kokoro-team removed the kokoro:run Trigger Google bot runs label Jul 20, 2023
Copy link
Contributor

@jeremy-lunarg jeremy-lunarg left a comment

Choose a reason for hiding this comment

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

LGTM

@arcady-lunarg arcady-lunarg merged commit 4420f9b into KhronosGroup:main Jul 27, 2023
@arcady-lunarg arcady-lunarg deleted the thread-local-pool-alloc branch October 14, 2024 16:59
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.

Crash in glslang::SetThreadPoolAllocator
4 participants