Tesseract 3.01
/data/source/tesseract-ocr/ccutil/memry.h File Reference
#include <stddef.h>
#include "host.h"

Go to the source code of this file.

Defines

#define JUSTCHECKS   0
#define MEMCHECKS   1
#define FULLMEMCHECKS   2
#define ALLOC_2D_ARRAY(x, y, mem, ptrs, type)
#define FREE_2D_ARRAY(mem, ptrs)
#define ALLOC_BIG_2D_ARRAY(x, y, mem, ptrs, type)
#define FREE_BIG_2D_ARRAY(mem, ptrs)

Functions

DLLSYM void check_mem (const char *string, inT8 level)
DLLSYM char * alloc_string (inT32 count)
DLLSYM void free_string (char *string)
DLLSYM void * alloc_struct (inT32 count, const char *name=NULL)
DLLSYM void free_struct (void *deadstruct, inT32 count, const char *name=NULL)
DLLSYM void * alloc_mem_p (inT32 count)
DLLSYM void * alloc_mem (inT32 count)
DLLSYM void * alloc_big_mem (inT32 count)
DLLSYM void * alloc_big_zeros (inT32 count)
DLLSYM void free_mem (void *oldchunk)
DLLSYM void free_big_mem (void *oldchunk)

Define Documentation

#define ALLOC_2D_ARRAY (   x,
  y,
  mem,
  ptrs,
  type 
)
Value:
/*make 2d array*/\
{ \
        inT32                                   TMP_i; \
        mem=(type*)alloc_mem((x)*(y)*sizeof(type));                     /*get memory*/\
        ptrs=(type**)alloc_mem((x)*sizeof(type*));                      /*get ptrs*/\
        for (TMP_i=0;TMP_i<(x);TMP_i++)\
                ptrs[TMP_i]=mem+(y)*TMP_i;                                              /*set ptrs*/\
} \
#define ALLOC_BIG_2D_ARRAY (   x,
  y,
  mem,
  ptrs,
  type 
)
Value:
/*make 2d array*/\
{ \
        inT32                                   TMP_i; \
        mem=(type*)alloc_big_mem((x)*(y)*sizeof(type));         /*get memory*/\
        ptrs=(type**)alloc_big_mem((x)*sizeof(type*));          /*get ptrs*/\
        for (TMP_i=0;TMP_i<(x);TMP_i++)\
                ptrs[TMP_i]=mem+(y)*TMP_i;                                              /*set ptrs*/\
} \
#define FREE_2D_ARRAY (   mem,
  ptrs 
)
Value:
/*free a 2D array*/\
{ \
        free_mem(mem);                                                                          /*free the memory*/\
        free_mem(ptrs);                                                                         /*and the ptrs*/\
} \
#define FREE_BIG_2D_ARRAY (   mem,
  ptrs 
)
Value:
/*free a 2D array*/\
{ \
        free_big_mem(mem);                                                                      /*free the memory*/\
        free_big_mem(ptrs);                                                                     /*and the ptrs*/\
} \
#define FULLMEMCHECKS   2
#define JUSTCHECKS   0
#define MEMCHECKS   1

Function Documentation

DLLSYM void* alloc_big_mem ( inT32  count)
DLLSYM void* alloc_big_zeros ( inT32  count)
DLLSYM void* alloc_mem ( inT32  count)
DLLSYM void* alloc_mem_p ( inT32  count)
DLLSYM char* alloc_string ( inT32  count)
DLLSYM void* alloc_struct ( inT32  count,
const char *  name = NULL 
)
DLLSYM void check_mem ( const char *  string,
inT8  level 
)
DLLSYM void free_big_mem ( void *  oldchunk)
DLLSYM void free_mem ( void *  oldchunk)
DLLSYM void free_string ( char *  string)
DLLSYM void free_struct ( void *  deadstruct,
inT32  count,
const char *  name = NULL 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines