LIBINT  2.6.0
Public Member Functions | List of all members
libint2::WorstFitMemoryManager Class Reference

WorstFitMemoryManager allocates memory by trying to find the largest-possible free block. More...

#include <memory.h>

Inheritance diagram for libint2::WorstFitMemoryManager:
Inheritance graph
[legend]
Collaboration diagram for libint2::WorstFitMemoryManager:
Collaboration graph
[legend]

Public Member Functions

 WorstFitMemoryManager (bool search_exact=true, const Size &maxsize=ULONG_MAX)
 
Address alloc (const Size &size)
 Implementation of MemoryManager::alloc()
 
- Public Member Functions inherited from libint2::MemoryManager
virtual void free (const Address &address)
 Release a block previously reserved using alloc.
 
Size max_memory_used () const
 Returns the max amount of memory used up to this moment.
 
void reset ()
 resets the state of MemoryManager; does not invalidate stats, however
 

Additional Inherited Members

- Public Types inherited from libint2::MemoryManager
typedef intptr_t Address
 Negative Address is used to denote an invalid address – hence signed integer.
 
typedef size_t Size
 
typedef MemoryBlock< Address, Size > MemBlock
 
- Static Public Attributes inherited from libint2::MemoryManager
static const Address InvalidAddress = -1
 
- Protected Types inherited from libint2::MemoryManager
typedef std::list< SafePtr< MemBlock > > memblkset
 
- Protected Member Functions inherited from libint2::MemoryManager
 MemoryManager (const Size &maxmem)
 
Size maxmem () const
 Returns maxmem.
 
memblkset & blocks ()
 Returns blocks.
 
SafePtr< MemBlocksuperblock () const
 Returns the superblock.
 
SafePtr< MemBlocksteal_from_block (const SafePtr< MemBlock > &blk, const Size &size)
 steals size memory from block blk and returns the new block
 
SafePtr< MemBlockfind_block (const Address &a)
 finds the block at Address a
 

Detailed Description

WorstFitMemoryManager allocates memory by trying to find the largest-possible free block.

If search_exact == true – exact fit is sought first.


The documentation for this class was generated from the following files: