Givaro
Data Structures | Namespaces | Macros | Functions
givaromm.h File Reference

Memory management in Givaro two memory managers: More...

#include <cstring>
#include <stddef.h>
#include <iostream>
#include <new>
#include "givaro/givmodule.h"
#include "givaro/givbasictype.h"
#include <givaro/givconfig.h>
+ Include dependency graph for givaromm.h:

Data Structures

class  GivMMInfo
 Static informations of memory allocation. More...
 
class  BlocFreeList
 Data structure of a bloc. More...
 
class  GivMMFreeList
 Implementation of a memory manager with free-lists. More...
 
class  GivMMRefCount
 Memory management with reference counter on allocated data. More...
 
class  GivaroMM< T >
 Memory manager that allocates array of object of type T for. More...
 

Namespaces

 Givaro
 Namespace in which the whole Givaro library resides.
 

Macros

#define GIVARO_MM_SPECIALIZED(TYPE)
 

Functions

std::ostream & operator<< (std::ostream &o, const GivMMInfo &T)
 IO. More...
 

Detailed Description

Memory management in Givaro two memory managers:

The latter used method of the former.

Macro Definition Documentation

◆ GIVARO_MM_SPECIALIZED

#define GIVARO_MM_SPECIALIZED (   TYPE)
Value:
template<> class GivaroMM<TYPE> {\
public: \
typedef TYPE* ptType;\
typedef TYPE Type;\
static ptType allocate (const size_t s);\
static void desallocate ( ptType bloc, const size_t sz =0 );\
static void initone( ptType p, const Type V = 0);\
static void initialize(ptType bloc, const size_t s, const Type V =0);\
static void destroy(GivaroMM<TYPE>::ptType bloc, const size_t s);\
};\
inline GivaroMM<TYPE>::ptType GivaroMM<TYPE>::allocate (const size_t s)\
{ return (GivaroMM<TYPE>::ptType)GivMMFreeList::allocate(s*sizeof(GivaroMM<TYPE>::Type)); }\
inline void GivaroMM<TYPE>::desallocate(GivaroMM<TYPE>::ptType bloc, const size_t sz)\
{ GivMMFreeList::desallocate((void*)bloc,sz); }\
inline void GivaroMM<TYPE>::initone( GivaroMM<TYPE>::ptType p, const GivaroMM<TYPE>::Type v) \
{ *p = v; }\
inline void GivaroMM<TYPE>::initialize(GivaroMM<TYPE>::ptType bloc, const size_t s, const GivaroMM<TYPE>::Type V)\
{ for (size_t i=0; i<s; i++) bloc[i] = V; }\
inline void GivaroMM<TYPE>::destroy(GivaroMM<TYPE>::ptType bloc, const size_t s){}
a p
Definition: rmadd.h:147