Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
tracking-allocator.cpp File Reference

Implementation of the common storage backend for the tracking test allocator. More...

Go to the source code of this file.

Description

Implementation of the common storage backend for the tracking test allocator.

  • PoolRegistry maintains a common hashtable with all MemoryPool instances; when using the standard accessors, registration and pool creating happens automatically.
  • in this setup, the pool with ID="GLOBAL" is just one further pool, which will be established when a front-end function is used with the default pool-ID (i.e. without explicit pool specification). Note however, that such a factory is still statefull (since it embeds a shared-ownership smart-pointer)
  • each MemoryPool contains a hashtable, where each active allocation is stored, using the storage-location as hashtable key. Each such entry gets a further consecutive internal ID, which is visible in the EventLog
    See also
    tracking-allocator.hpp
    TestTracking_test::demonstrate_checkAllocator()

Definition in file tracking-allocator.cpp.

#include "lib/test/tracking-allocator.hpp"
#include "lib/uninitialised-storage.hpp"
#include "lib/iter-explorer.hpp"
#include "lib/depend.hpp"
#include "lib/util.hpp"
#include <string>
#include <unordered_map>

Namespaces

namespace  lib
 Implementation namespace for support and library code.
 
namespace  lib::test
 Unit tests for the Lumiera support library.
 
namespace  lib::test::anonymous_namespace{tracking-allocator.cpp}
 

Classes

class  MemoryPool
 
struct  MemoryPool::LocationHash
 
struct  MemoryPool::Allocation
 registration entry to maintain a single allocation More...
 
class  PoolRegistry
 keep track of any distinct memory pools used More...
 

Functions

EventLoglog ()
 
template<typename... XS>
void logAlarm (XS const &...xs)
 
template<typename... ARGS>
void logAlloc (Literal pool, string fun, ARGS const &...args)
 

Variables

Depend< MemoryPoolglobalPool
 singleton for default pool
 
Depend< PoolRegistrypoolReg