tesseract  4.00.00dev
memry.cpp File Reference
#include "memry.h"
#include <stdlib.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 free_mem (void *oldchunk)
 

Function Documentation

◆ 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_mem()

void free_mem ( void *  oldchunk)

Definition at line 43 of file memry.cpp.

43  {
44  free(oldchunk);
45 }

◆ free_string()

void free_string ( char *  string)

Definition at line 35 of file memry.cpp.

35  {
36  free(string);
37 }