Skip to content

Commit

Permalink
Fixed excessive growth of ACS string pool
Browse files Browse the repository at this point in the history
This fixes usage of uninitialized variable in ACSStringPool::PoolEntry objects
The initial version (before 66d15dc) increased pool size by one entry and assign all its members right after that
The improved version reserved MIN_GC_SIZE entries but didn't initialize anything except the first one
ACSStringPool::FindFirstFreeEntry() cannot find the proper entry as it uses PoolEntry::Next member for list traversal
It's enough to initialize Next member with FREE_ENTRY value because other fields will be assigned anyway inside ACSStringPool::InsertString()

https://forum.zdoom.org/viewtopic.php?t=60049
  • Loading branch information
alexey-lysiuk committed Apr 1, 2018
1 parent 23146c9 commit 5df5e2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/p_acs.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class ACSStringPool
{
FString Str;
unsigned int Hash;
unsigned int Next;
unsigned int Next = FREE_ENTRY;
bool Mark;
TArray<int> Locks;

Expand Down

0 comments on commit 5df5e2a

Please sign in to comment.