1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0033138: [Foundation Classes] - NCollection_IncAllocator- Decrease the default block size

Set default memory block size for IncAllocator to 12KB to make sure the Low Fragmentation Heap is used for memory allocations on Windows platform.
This commit is contained in:
Eugeny Maltchikov
2022-09-12 11:00:49 +03:00
committed by smoskvin
parent 259b930379
commit 9218d04b9a
2 changed files with 15 additions and 3 deletions

View File

@@ -1331,7 +1331,7 @@ Therefore if the user of *NCollection* does not specify any allocator as a param
Nevertheless, it is possible to define a custom *Allocator* type to manage the memory in the most optimal or convenient way for this algorithm.
As one possible choice, the class *NCollection_IncAllocator* is included.
Unlike *NCollection_BaseAllocator*, the memory is allocated in big blocks (about 20kB) and the allocator keeps track of the amount of occupied memory.
Unlike *NCollection_BaseAllocator*, the memory is allocated in big blocks (about 12kB) and the allocator keeps track of the amount of occupied memory.
The method *Allocate* just increments the pointer to non-occupied memory and returns its previous value.
Memory is only released in the destructor of *NCollection_IncAllocator*, the method *Free* is empty.
If used properly, this Allocator can greatly improve the performance of specific algorithms.