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());


class TlsBlockPool
    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

Subscription expired — please renew

Pro account upgrade has expired for this site and the site is now locked. If you are the master administrator for this site, please renew your subscription or delete your outstanding sites or stored files, so that your account fits in the free plan.