Back to index

texmacs  1.0.7.15
Defines | Functions | Variables
fast_alloc.hpp File Reference
#include "tm_configure.hpp"
#include <stdlib.h>
#include "tm_ostream.hpp"
#include <new>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define BLOCK_SIZE   65536
#define alloc_ptr(i)   (*((void **) (alloc_table+i)))
#define ind(ptr)   (*((void **) ptr))

Functions

void * safe_malloc (register size_t s)
void * enlarge_malloc (register size_t s)
void * fast_alloc (register size_t s)
void fast_free (register void *ptr, register size_t s)
void * fast_new (register size_t s)
void fast_delete (register void *ptr)
int mem_used ()
void mem_info ()
template<typename C >
Ctm_new ()
template<typename C , typename A1 >
Ctm_new (const A1 &a1)
template<typename C , typename A1 , typename A2 >
Ctm_new (const A1 &a1, const A2 &a2)
template<typename C , typename A1 , typename A2 >
Ctm_new (const A1 &a1, A2 &a2)
template<typename C , typename A1 , typename A2 >
Ctm_new (A1 &a1, const A2 &a2)
template<typename C , typename A1 , typename A2 >
Ctm_new (A1 &a1, A2 &a2)
template<typename C , typename A1 , typename A2 , typename A3 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3)
template<typename C , typename A1 , typename A2 , typename A3 >
Ctm_new (const A1 &a1, A2 &a2, A3 &a3)
template<typename C , typename A1 , typename A2 , typename A3 >
Ctm_new (A1 &a1, A2 &a2, const A3 &a3)
template<typename C , typename A1 , typename A2 , typename A3 >
Ctm_new (A1 &a1, A2 &a2, A3 &a3)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 >
Ctm_new (const A1 &a1, A2 &a2, A3 &a3, A4 &a4)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
Ctm_new (const A1 &a1, A2 &a2, A3 &a3, A4 &a4, A5 &a5)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
Ctm_new (A1 &a1, A2 &a2, A3 &a3, A4 &a4, A5 &a5)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
Ctm_new (A1 &a1, const A2 &a2, A3 &a3, A4 &a4, A5 &a5, A6 &a6)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9, const A10 &a10)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9, const A10 &a10, const A11 &a11)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9, const A10 &a10, const A11 &a11, const A12 &a12)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9, const A10 &a10, const A11 &a11, const A12 &a12, const A13 &a13)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9, const A10 &a10, const A11 &a11, const A12 &a12, const A13 &a13, const A14 &a14)
template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 >
Ctm_new (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9, const A10 &a10, const A11 &a11, const A12 &a12, const A13 &a13, const A14 &a14, const A15 &a15)
template<typename C >
void tm_delete (C *ptr)
template<typename C >
Ctm_new_array (int n)
template<typename C >
void tm_delete_array (C *Ptr)

Variables

char alloc_table [MAX_FAST]
char * alloc_mem
size_t alloc_remains
int allocated
int large_uses

Define Documentation

#define alloc_ptr (   i)    (*((void **) (alloc_table+i)))

Definition at line 31 of file fast_alloc.hpp.

#define BLOCK_SIZE   65536

Definition at line 19 of file fast_alloc.hpp.

#define ind (   ptr)    (*((void **) ptr))

Definition at line 32 of file fast_alloc.hpp.


Function Documentation

void* enlarge_malloc ( register size_t  s)

Definition at line 43 of file fast_alloc.cpp.

                                    {
  if (alloc_remains<sz) {
    alloc_mem    = (char *) safe_malloc (BLOCK_SIZE);
    alloc_remains= BLOCK_SIZE;
    fast_chunks++;
  }
  register void* ptr= alloc_mem;
  alloc_mem    += sz;
  alloc_remains-= sz;
  return ptr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* fast_alloc ( register size_t  s)

Definition at line 56 of file fast_alloc.cpp.

                                {
  sz= (sz+WORD_LENGTH_INC)&WORD_MASK;
  if (sz<MAX_FAST) {
    register void *ptr= alloc_ptr (sz);
    if (ptr==NULL) return enlarge_malloc (sz);
    alloc_ptr (sz)= ind (ptr);
    return ptr;
  }
  else {
    if (MEM_DEBUG>=3) cout << "Big alloc of " << sz << " bytes\n";
    if (MEM_DEBUG>=3) cout << "Memory used: " << mem_used () << " bytes\n";
    large_uses += sz;
    return safe_malloc (sz);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fast_delete ( register void *  ptr)

Definition at line 150 of file fast_alloc.cpp.

                                 {
  ptr= (void*) (((char*) ptr)- WORD_LENGTH);
  register size_t s= *((size_t *) ptr);
  if (s<MAX_FAST) {
    ind(ptr)    = alloc_ptr(s);
    alloc_ptr(s)= ptr;
  }
  else {
    if (MEM_DEBUG>=3) cout << "Big free of " << s << " bytes\n";
    //if ((((int) ptr) & 15) != 0) cout << "Unaligned delete " << ptr << "\n";
    free (ptr);
    large_uses -= s;
    if (MEM_DEBUG>=3) cout << "Memory used: " << mem_used () << " bytes\n";
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fast_free ( register void *  ptr,
register size_t  s 
)

Definition at line 73 of file fast_alloc.cpp.

                                                   {
  sz=(sz+WORD_LENGTH_INC)&WORD_MASK;
  if (sz<MAX_FAST) {
    ind (ptr)     = alloc_ptr (sz);
    alloc_ptr (sz)= ptr;
  }
  else {
    if (MEM_DEBUG>=3) cout << "Big free of " << sz << " bytes\n";
    large_uses -= sz;    
    free (ptr);
    if (MEM_DEBUG>=3) cout << "Memory used: " << mem_used () << " bytes\n";
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* fast_new ( register size_t  s)

Definition at line 130 of file fast_alloc.cpp.

                             {
  register void* ptr;
  s= (s+ WORD_LENGTH+ WORD_LENGTH_INC)&WORD_MASK;
  if (s<MAX_FAST) {
    ptr= alloc_ptr(s);
    if (ptr==NULL) ptr= enlarge_malloc (s);
    else alloc_ptr(s)= ind(ptr);
  }
  else {
    if (MEM_DEBUG>=3) cout << "Big alloc of " << s << " bytes\n";
    if (MEM_DEBUG>=3) cout << "Memory used: " << mem_used () << " bytes\n";
    ptr= safe_malloc (s);
    //if ((((int) ptr) & 15) != 0) cout << "Unaligned new " << ptr << "\n";
    large_uses += s;
  }
  *((size_t *) ptr)=s;
  return (void*) (((char*) ptr)+ WORD_LENGTH);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mem_info ( )

Definition at line 218 of file fast_alloc.cpp.

            {
  cout << "\n---------------- memory statistics ----------------\n";
  int free_bytes= alloc_remains;
  int chunks_use= BLOCK_SIZE*fast_chunks;
  int i;
  for (i=WORD_LENGTH; i<MAX_FAST; i+=WORD_LENGTH)
    free_bytes += i*compute_free (alloc_table+i);
  int small_uses= chunks_use- free_bytes;
  int total_uses= small_uses+ large_uses;
  // cout << "Fast chunks   : " << chunks_use << " bytes\n";
  // cout << "Free on chunks: " << alloc_remains << " bytes\n";
  cout << "User          : " << total_uses << " bytes\n";
  cout << "Allocator     : " << chunks_use+ large_uses << " bytes\n";
  cout << "Small mallocs : "
       << ((100*((float) small_uses))/((float) total_uses)) << "%\n";
}

Here is the call graph for this function:

Here is the caller graph for this function:

int mem_used ( )

Definition at line 207 of file fast_alloc.cpp.

            {
  int free_bytes= alloc_remains;
  int chunks_use= BLOCK_SIZE*fast_chunks;
  int i;
  for (i=WORD_LENGTH; i<MAX_FAST; i+=WORD_LENGTH)
    free_bytes += i*compute_free (alloc_table+i);
  int small_uses= chunks_use- free_bytes;
  return small_uses+ large_uses;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* safe_malloc ( register size_t  s)

Definition at line 33 of file fast_alloc.cpp.

                                 {
  void* ptr= malloc (sz);
  if (ptr==NULL) {
    cerr << "Fatal error: out of memory\n";
    abort ();
  }
  return ptr;
}

Here is the caller graph for this function:

template<typename C >
void tm_delete ( C ptr) [inline]

Definition at line 320 of file fast_alloc.hpp.

                   {
  ptr -> ~C ();
  fast_delete ((void*) ptr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename C >
void tm_delete_array ( C Ptr) [inline]

Definition at line 337 of file fast_alloc.hpp.

                         {
  void* ptr= (void*) Ptr;
  ptr= (void*) (((char*) ptr) - WORD_LENGTH);
  int n= *((int*) ptr);
  C* ctr= Ptr+n-1;
  for (int i=0; i<n; i++, ctr--) ctr -> ~C();
  fast_free (ptr, n * sizeof (C) + WORD_LENGTH);
}

Here is the call graph for this function:

template<typename C >
C* tm_new ( ) [inline]

Definition at line 62 of file fast_alloc.hpp.

          {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C ();
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 >
C* tm_new ( const A1 &  a1) [inline]

Definition at line 69 of file fast_alloc.hpp.

                      {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 >
C* tm_new ( const A1 &  a1,
const A2 &  a2 
) [inline]

Definition at line 76 of file fast_alloc.hpp.

                                    {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 >
C* tm_new ( const A1 &  a1,
A2 &  a2 
) [inline]

Definition at line 83 of file fast_alloc.hpp.

                              {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 >
C* tm_new ( A1 &  a1,
const A2 &  a2 
) [inline]

Definition at line 90 of file fast_alloc.hpp.

                              {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 >
C* tm_new ( A1 &  a1,
A2 &  a2 
) [inline]

Definition at line 97 of file fast_alloc.hpp.

                        {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3 
) [inline]

Definition at line 104 of file fast_alloc.hpp.

                                                  {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 >
C* tm_new ( const A1 &  a1,
A2 &  a2,
A3 &  a3 
) [inline]

Definition at line 111 of file fast_alloc.hpp.

                                      {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 >
C* tm_new ( A1 &  a1,
A2 &  a2,
const A3 &  a3 
) [inline]

Definition at line 118 of file fast_alloc.hpp.

                                      {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 >
C* tm_new ( A1 &  a1,
A2 &  a2,
A3 &  a3 
) [inline]

Definition at line 125 of file fast_alloc.hpp.

                                {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4 
) [inline]

Definition at line 133 of file fast_alloc.hpp.

                     {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 >
C* tm_new ( const A1 &  a1,
A2 &  a2,
A3 &  a3,
A4 &  a4 
) [inline]

Definition at line 142 of file fast_alloc.hpp.

                                              {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5 
) [inline]

Definition at line 150 of file fast_alloc.hpp.

                                   {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
C* tm_new ( const A1 &  a1,
A2 &  a2,
A3 &  a3,
A4 &  a4,
A5 &  a5 
) [inline]

Definition at line 159 of file fast_alloc.hpp.

                                                      {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
C* tm_new ( A1 &  a1,
A2 &  a2,
A3 &  a3,
A4 &  a4,
A5 &  a5 
) [inline]

Definition at line 167 of file fast_alloc.hpp.

                                                {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6 
) [inline]

Definition at line 175 of file fast_alloc.hpp.

                                                 {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
C* tm_new ( A1 &  a1,
const A2 &  a2,
A3 &  a3,
A4 &  a4,
A5 &  a5,
A6 &  a6 
) [inline]

Definition at line 184 of file fast_alloc.hpp.

                                                              {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7 
) [inline]

Definition at line 192 of file fast_alloc.hpp.

                     {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7 
) [inline]

Definition at line 202 of file fast_alloc.hpp.

                     {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8 
) [inline]

Definition at line 213 of file fast_alloc.hpp.

                                   {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9 
) [inline]

Definition at line 224 of file fast_alloc.hpp.

                                                 {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9,
const A10 &  a10 
) [inline]

Definition at line 236 of file fast_alloc.hpp.

                       {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9,
const A10 &  a10,
const A11 &  a11 
) [inline]

Definition at line 249 of file fast_alloc.hpp.

                                       {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9,
const A10 &  a10,
const A11 &  a11,
const A12 &  a12 
) [inline]

Definition at line 262 of file fast_alloc.hpp.

                                                       {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9,
const A10 &  a10,
const A11 &  a11,
const A12 &  a12,
const A13 &  a13 
) [inline]

Definition at line 276 of file fast_alloc.hpp.

                       {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
                    a11, a12, a13);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9,
const A10 &  a10,
const A11 &  a11,
const A12 &  a12,
const A13 &  a13,
const A14 &  a14 
) [inline]

Definition at line 292 of file fast_alloc.hpp.

                                       {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
                    a11, a12, a13, a14);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9 , typename A10 , typename A11 , typename A12 , typename A13 , typename A14 , typename A15 >
C* tm_new ( const A1 &  a1,
const A2 &  a2,
const A3 &  a3,
const A4 &  a4,
const A5 &  a5,
const A6 &  a6,
const A7 &  a7,
const A8 &  a8,
const A9 &  a9,
const A10 &  a10,
const A11 &  a11,
const A12 &  a12,
const A13 &  a13,
const A14 &  a14,
const A15 &  a15 
) [inline]

Definition at line 308 of file fast_alloc.hpp.

                                                       {
  void* ptr= fast_new (sizeof (C));
  (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
                    a11, a12, a13, a14, a15);
  return (C*) ptr;
}

Here is the call graph for this function:

template<typename C >
C* tm_new_array ( int  n) [inline]

Definition at line 326 of file fast_alloc.hpp.

                     {
  void* ptr= fast_alloc (n * sizeof (C) + WORD_LENGTH);
  *((int*) ptr)= n;
  ptr= (void*) (((char*) ptr) + WORD_LENGTH);
  C* ctr= (C*) ptr;
  for (int i=0; i<n; i++, ctr++)
    (void) new ((void*) ctr) C ();
  return (C*) ptr;
}

Here is the call graph for this function:


Variable Documentation

char* alloc_mem

Definition at line 20 of file fast_alloc.cpp.

size_t alloc_remains

Definition at line 21 of file fast_alloc.cpp.

char alloc_table[MAX_FAST]

Definition at line 19 of file fast_alloc.cpp.

int allocated

Definition at line 22 of file fast_alloc.cpp.

Definition at line 24 of file fast_alloc.cpp.