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
698bf754
Commit
698bf754
authored
Nov 21, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Memory: Mak full explicit destructor functionality, techincally correctly.
Completes a TODO from previous commit.
parent
1cf2b355
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
PoolAlloc.cpp
glslang/MachineIndependent/PoolAlloc.cpp
+7
-4
No files found.
glslang/MachineIndependent/PoolAlloc.cpp
View file @
698bf754
...
@@ -202,14 +202,17 @@ void TPoolAllocator::pop()
...
@@ -202,14 +202,17 @@ void TPoolAllocator::pop()
while
(
inUseList
!=
page
)
{
while
(
inUseList
!=
page
)
{
tHeader
*
nextInUse
=
inUseList
->
nextPage
;
tHeader
*
nextInUse
=
inUseList
->
nextPage
;
if
(
inUseList
->
pageCount
>
1
)
{
size_t
pageCount
=
inUseList
->
pageCount
;
inUseList
->~
tHeader
();
// currently, just a debug allocation checker
// This technically ends the lifetime of the header as C++ object,
// but we will still control the memory and reuse it.
inUseList
->~
tHeader
();
// currently, just a debug allocation checker
if
(
pageCount
>
1
)
{
delete
[]
reinterpret_cast
<
char
*>
(
inUseList
);
delete
[]
reinterpret_cast
<
char
*>
(
inUseList
);
}
else
{
}
else
{
inUseList
->
nextPage
=
freeList
;
inUseList
->
nextPage
=
freeList
;
freeList
=
inUseList
;
freeList
=
inUseList
;
// inUseList->~tHeader(); TODO: this should probably call the allocation checker, but not the destructor
// ...if the destructor actually overwrites nextPage, that would effect freeList->nextPage
}
}
inUseList
=
nextInUse
;
inUseList
=
nextInUse
;
}
}
...
...
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