Skip to content

Commit 7cf3579

Browse files
authored
fix amount of ram allocation (#233)
1 parent f86f13e commit 7cf3579

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/transptable.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ HASH::HASH(){
2929
U64 tableSizeMax = hashSize / (double) sizeof(HASH_Entry) * 0x100000; // по идее это должно быть 1 МБ
3030
TableSize = 1;
3131

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

64-
while (TableSize / 2 <= tableSizeMax){
64+
while (TableSize * 2 <= tableSizeMax){
6565
TableSize *= 2;
6666
}
6767
hashTable = new HASH_Entry [TableSize];

0 commit comments

Comments
 (0)