Skip to content

Commit 9bc2971

Browse files
committed
buffer: use MempoolInstance as default allocator
Currently we use MempoolHolder as default allocator - it makes all buffers use the same MempoolInstance. This buffer cannot be used in Multi-Threaded scenarios, so let's simply use `MempoolInstance` instead - now each connection will use its own allocator. To reduce memory footprint of each connection, let's set default parameter `M = slab_size / block_size` to 16 to use 256KB slabs by default. Part of #110
1 parent e8c0a6c commit 9bc2971

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Buffer/Buffer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace tnt {
5858
* REAL_SIZE - constant determines real size of allocated chunk (excluding
5959
* overhead taken by allocator).
6060
*/
61-
template <size_t N = 16 * 1024, class allocator = MempoolHolder<N>>
61+
template <size_t N = 16 * 1024, class allocator = MempoolInstance<N, 16>>
6262
class Buffer
6363
{
6464
private:

0 commit comments

Comments
 (0)