Lumiera  0.pre.03
»edit your freedom«
tracking-heap-block-provider.hpp File Reference

Go to the source code of this file.

Description

Dummy implementation of the BufferProvider interface to support writing unit tests.

This BufferProvider is especially straight forward and brain dead: it just claims more and more heap blocks and never releases any memory dynamically. This allows to investigate additional tracking status flags for each allocated block after the fact.

The allocated buffers are numbered with a simple ascending sequence of integers, used as LocalKey (see BufferMetadata). Clients can just request a Buffer with the given number, causing that block to be allocated. There is a "backdoor", allowing to access any allocated block, even if it is considered "released" by the terms of the usual lifecycle. Only when the provider object itself gets destroyed, all allocated blocks will be discarded.

See also
DiagnosticOutputSlot
DiagnosticBufferProvider
buffer-provider-protocol-test.cpp

Definition in file tracking-heap-block-provider.hpp.

#include "lib/error.hpp"
#include "lib/hash-value.h"
#include "steam/engine/buffer-provider.hpp"
#include "lib/scoped-ptrvect.hpp"
#include <unordered_map>
#include <memory>

Classes

class  Block
 Helper for implementing a diagnostic BufferProvider: A block of heap allocated storage, with the capability to store some additional tracking information. More...
 
class  TrackingHeapBlockProvider
 simple BufferProvider implementation with additional allocation tracking. More...
 

Typedefs

typedef std::unordered_map< HashVal, BlockPool > PoolTable
 

Namespaces

 steam
 Steam-Layer implementation namespace root.
 
 steam::engine
 Lumiera's render engine core and operational control.