tesseract  4.00.00dev
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_mem (inT32 count)
 
void * alloc_big_zeros (inT32 count)
 
void free_mem (void *oldchunk)
 
void free_big_mem (void *oldchunk)
 

Function Documentation

◆ alloc_big_zeros()

void* alloc_big_zeros ( inT32  count)

Definition at line 43 of file memry.cpp.

43  {
44  return calloc(static_cast<size_t>(count), 1);
45 }
int count(LIST var_list)
Definition: oldlist.cpp:103

◆ alloc_mem()

void* alloc_mem ( inT32  count)

Definition at line 39 of file memry.cpp.

39  {
40  return malloc(static_cast<size_t>(count));
41 }
int count(LIST var_list)
Definition: oldlist.cpp:103

◆ alloc_string()

char* alloc_string ( inT32  count)

Definition at line 30 of file memry.cpp.

30  {
31  // Round up the amount allocated to a multiple of 4
32  return static_cast<char*>(malloc((count + 3) & ~3));
33 }
int count(LIST var_list)
Definition: oldlist.cpp:103

◆ free_big_mem()

void free_big_mem ( void *  oldchunk)

Definition at line 51 of file memry.cpp.

51  {
52  free(oldchunk);
53 }

◆ free_mem()

void free_mem ( void *  oldchunk)

Definition at line 47 of file memry.cpp.

47  {
48  free(oldchunk);
49 }

◆ free_string()

void free_string ( char *  string)

Definition at line 35 of file memry.cpp.

35  {
36  free(string);
37 }