TlsBlockPool

Introduction

I add a new class: TlsBlockPool. And now you can define a ScopeAlloc instance without given parameters:

ScopeAlloc alloc;

It is same as:

ScopeAlloc alloc(TlsBlockPool::instance());

Specification

class TlsBlockPool
{
public:
    TlsBlockPool() { init(); }
    ~TlsBlockPool() { term(); }
 
    static void init();
    static void term();
 
    static BlockPool& instance();
};

Note: TlsBlockPool::init() can be called more than once. each call to TlsBlockPool::init() must be balanced by a corresponding call to TlsBlockPool::term().

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License