Skip to content

Commit

Permalink
fix amount of ram allocation (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
justNo4b authored Dec 20, 2023
1 parent f86f13e commit 7cf3579
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transptable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ HASH::HASH(){
U64 tableSizeMax = hashSize / (double) sizeof(HASH_Entry) * 0x100000; // по идее это должно быть 1 МБ
TableSize = 1;

while (TableSize / 2 <= tableSizeMax){
while (TableSize * 2 <= tableSizeMax){
TableSize *= 2;
}
hashTable = new HASH_Entry [TableSize];
Expand All @@ -41,7 +41,7 @@ HASH::HASH(){
// Потом ближайшее число которое есть степень двойки (ускоряем вычисления id)
U64 ptableSizeMax = p_Size / (double) sizeof(pawn_HASH_Entry) * 0x100000;
pTableSize = 1;
while (pTableSize / 2 <= ptableSizeMax){
while (pTableSize * 2 <= ptableSizeMax){
pTableSize *= 2;
}
pHASH = new pawn_HASH_Entry[pTableSize];
Expand All @@ -61,7 +61,7 @@ void HASH::HASH_Initalize_MB(const int MB){
U64 tableSizeMax = hashSize / (double) sizeof(HASH_Entry) * 0x100000;
TableSize = 1;

while (TableSize / 2 <= tableSizeMax){
while (TableSize * 2 <= tableSizeMax){
TableSize *= 2;
}
hashTable = new HASH_Entry [TableSize];
Expand Down

0 comments on commit 7cf3579

Please sign in to comment.