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

Go to the source code of this file.

Functions

char * alloc_string (inT32 count)
void free_string (char *string)
void * alloc_struct (inT32 count, const char *name=NULL)
void free_struct (void *deadstruct, inT32, const char *name=NULL)
void * alloc_mem (inT32 count)
void * alloc_big_zeros (inT32 count)
void free_mem (void *oldchunk)
void free_big_mem (void *oldchunk)

Function Documentation

void* alloc_big_zeros ( inT32  count)

Definition at line 52 of file memry.cpp.

                                   {
  return calloc(static_cast<size_t>(count), 1);
}
void* alloc_mem ( inT32  count)

Definition at line 48 of file memry.cpp.

                             {
  return malloc(static_cast<size_t>(count));
}
char* alloc_string ( inT32  count)

Definition at line 31 of file memry.cpp.

                                {
  // Round up the amount allocated to a multiple of 4
  return static_cast<char*>(malloc((count + 3) & ~3));
}
void* alloc_struct ( inT32  count,
const char *  name = NULL 
)

Definition at line 40 of file memry.cpp.

                                              {
  return malloc(count);
}
void free_big_mem ( void *  oldchunk)

Definition at line 60 of file memry.cpp.

                                  {
  free(oldchunk);
}
void free_mem ( void *  oldchunk)

Definition at line 56 of file memry.cpp.

                              {
  free(oldchunk);
}
void free_string ( char *  string)

Definition at line 36 of file memry.cpp.

                               {
  free(string);
}
void free_struct ( void *  deadstruct,
inT32  ,
const char *  name = NULL 
)

Definition at line 44 of file memry.cpp.

                                                        {
  free(deadstruct);
}