Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
74bde987
Commit
74bde987
authored
Nov 13, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Memory: Restore unused interfaces, in case other tools called them.
parent
94f28eb6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
0 deletions
+50
-0
InitializeDll.cpp
OGLCompilersDLL/InitializeDll.cpp
+47
-0
InitializeDll.h
OGLCompilersDLL/InitializeDll.h
+2
-0
ossource.cpp
glslang/OSDependent/Unix/ossource.cpp
+1
-0
No files found.
OGLCompilersDLL/InitializeDll.cpp
View file @
74bde987
...
@@ -115,4 +115,51 @@ bool InitThread()
...
@@ -115,4 +115,51 @@ bool InitThread()
return
true
;
return
true
;
}
}
// Not necessary to call this: InitThread() is reentrant, and the need
// to do per thread tear down has been removed.
//
// This is kept, with memory management removed, to satisfy any exiting
// calls to it that rely on it.
bool
DetachThread
()
{
bool
success
=
true
;
if
(
ThreadInitializeIndex
==
OS_INVALID_TLS_INDEX
)
return
true
;
//
// Function is re-entrant and this thread may not have been initialized.
//
if
(
OS_GetTLSValue
(
ThreadInitializeIndex
)
!=
0
)
{
if
(
!
OS_SetTLSValue
(
ThreadInitializeIndex
,
(
void
*
)
0
))
{
assert
(
0
&&
"DetachThread(): Unable to clear init flag."
);
success
=
false
;
}
}
return
success
;
}
// Not necessary to call this: InitProcess() is reentrant.
//
// This is kept, with memory management removed, to satisfy any exiting
// calls to it that rely on it.
//
// Users of glslang should call shFinalize() or glslang::FinalizeProcess() for
// process-scoped memory tear down.
bool
DetachProcess
()
{
bool
success
=
true
;
if
(
ThreadInitializeIndex
==
OS_INVALID_TLS_INDEX
)
return
true
;
success
=
DetachThread
();
OS_FreeTLSIndex
(
ThreadInitializeIndex
);
ThreadInitializeIndex
=
OS_INVALID_TLS_INDEX
;
return
success
;
}
}
// end namespace glslang
}
// end namespace glslang
OGLCompilersDLL/InitializeDll.h
View file @
74bde987
...
@@ -40,6 +40,8 @@ namespace glslang {
...
@@ -40,6 +40,8 @@ namespace glslang {
bool
InitProcess
();
bool
InitProcess
();
bool
InitThread
();
bool
InitThread
();
bool
DetachThread
();
// not called from standalone, perhaps other tools rely on parts of it
bool
DetachProcess
();
// not called from standalone, perhaps other tools rely on parts of it
}
// end namespace glslang
}
// end namespace glslang
...
...
glslang/OSDependent/Unix/ossource.cpp
View file @
74bde987
...
@@ -56,6 +56,7 @@ namespace glslang {
...
@@ -56,6 +56,7 @@ namespace glslang {
//
//
static
void
DetachThreadLinux
(
void
*
)
static
void
DetachThreadLinux
(
void
*
)
{
{
DetachThread
();
}
}
//
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment