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

Using C++11 features for replacing current OS specific code. #826

Closed
wants to merge 1 commit into from

Conversation

jantlo
Copy link
Contributor

@jantlo jantlo commented Apr 7, 2017

TLS code remove at all, replaced by the thread_local specifier. This also
impacts in the initialization process simplifying it a lot. The
functions Init/DetachProcess, Init/DetachThread have been removed. The
only function needed to be called for a proper initializations is
InitializeMemoryPools (FreeMemoryPools is optional during th shutdown).

TLS Support for MSVC 2013 is limited, only PODs are allowed to be used
and the specific extension should be used for it. This prevents us to do
further code simplifications.

The OGLCompilersDLL dynamic library is not needed anymore and has been
removed from the solution.

The way how is handle the PoolAllocators has been slightly modified. The
SetThreadPoolAllocator now receives a unique_ptr for the new
PoolAllocator and returns another unique_ptr for the old one. The goal
is to clearly define who is the ownership of those pool allocators in any
moment. Therefore the member variables pools in any object must be from
now a unique_ptr.

Overall this change removes 560 lines and adds 87.

@jantlo
Copy link
Contributor Author

jantlo commented Apr 7, 2017

After this changes the OSDependent dynamic library contains only one method: OS_DumpMemoryCounters which is only used for debug purposes in StandAlone.cpp file. I would like to move this function there and remove the OSDependent library.

TLS code remove at all, replaced by the thread_local specifier. This also
impacts in the initialization process simplifying it a lot. The
functions Init/DetachProcess, Init/DetachThread have been removed. The
only function needed to be called for a proper initializations is
InitializeMemoryPools (FreeMemoryPools is optional during th shutdown).

TLS Support for MSVC 2013 is limited, only PODs are allowed to be used
and the specific extension should be used for it. This prevents us to do
further code simplifications.

The OGLCompilersDLL dynamic library is not needed anymore and has been
removed from the solution.

The way how is handle the PoolAllocators has been slightly modified. The
SetThreadPoolAllocator now receives a unique_ptr for the new
PoolAllocator and returns another unique_ptr for the old one. The goal
is to clearly define who is the ownership of those pool allocators in any
moment. Therefore the member variables pools in any object must be from
now a unique_ptr.

Overall this change removes 560 lines and adds 87.
@johnkslang
Copy link
Member

This would be nice. Do you know what performance impact it has? Is it the same underlying mechanism, just abstracted, or is it possibly different on some platforms?

@jantlo
Copy link
Contributor Author

jantlo commented Apr 12, 2017

I wouldn't expect any impact in the performance. The C++11 version behaviour should be very well defined, regarding the pre-C++11 version extensions it is hard to say.

@xorgy
Copy link
Contributor

xorgy commented Oct 18, 2017

Seems as though you could ditch OSDependent/Unix altogether, since it is completely inert.

@CLAassistant
Copy link

CLAassistant commented Aug 22, 2019

CLA assistant check
All committers have signed the CLA.

@johnkslang
Copy link
Member

Closing this one, as the key feature was covered by #2348, a more up-to-date request, triggered by dropping VS 2013.

@johnkslang johnkslang closed this Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants