special_alloc.hpp File Reference

re-definition of new and delete class operator More...

#include "../my_config.h"
#include <stddef.h>

Go to the source code of this file.

Namespaces

namespace  libdar
 

libdar namespace encapsulate all libdar symbols


Defines

#define USE_SPECIAL_ALLOC(BASE_TYPE)

Functions

void libdar::special_alloc_init_for_thread_safe ()
void * libdar::special_alloc_new (size_t taille)
void libdar::special_alloc_delete (void *ptr)

Detailed Description

re-definition of new and delete class operator

this is a set of macro that makes the new and delete operator for a class be re-defined in a way that allocation is done in big chunks at the system level, and is split in small requested pieces for a given object allocation. This bring some performance improvment, because a lot a small objects that live and die toghether have to be allocated.

Definition in file special_alloc.hpp.


Define Documentation

#define USE_SPECIAL_ALLOC ( BASE_TYPE   ) 
Value:
void *operator new(size_t taille) { return special_alloc_new(taille); };                \
        void *operator new(size_t taille, BASE_TYPE * & place) { return (void *) place; };      \
        void *operator new(size_t taille, void * & place) { return place; };                    \
        void operator delete(void *ptr) { special_alloc_delete(ptr); }

Definition at line 54 of file special_alloc.hpp.

 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines

Generated on Sun Feb 26 12:45:46 2012 for Disk ARchive by  doxygen 1.6.1