Remove memry.cpp, memry.h

The proprietary memory allocators alloc_string, alloc_mem
are no longer used.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-06-25 15:47:59 +02:00
parent cda04b1d6d
commit db7f2009d9
3 changed files with 2 additions and 81 deletions

View File

@ -19,7 +19,7 @@ pkginclude_HEADERS = \
noinst_HEADERS = \
ambigs.h basedir.h bits16.h bitvector.h ccutil.h clst.h doubleptr.h elst2.h \
elst.h errcode.h fileerr.h genericheap.h globaloc.h \
indexmapbidi.h kdpair.h lsterr.h memry.h \
indexmapbidi.h kdpair.h lsterr.h \
nwmain.h object_cache.h params.h qrsequence.h sorthelper.h stderr.h \
scanutils.h tessdatamanager.h tprintf.h \
unicharcompress.h unicharmap.h unicharset.h unicity_table.h unicodes.h \
@ -32,7 +32,7 @@ libtesseract_ccutil_la_SOURCES = \
ccutil.cpp clst.cpp \
elst2.cpp elst.cpp errcode.cpp \
globaloc.cpp indexmapbidi.cpp \
mainblk.cpp memry.cpp \
mainblk.cpp \
serialis.cpp strngs.cpp scanutils.cpp \
tessdatamanager.cpp tprintf.cpp \
unichar.cpp unicharcompress.cpp unicharmap.cpp unicharset.cpp unicodes.cpp \

View File

@ -1,45 +0,0 @@
/**********************************************************************
* File: memry.cpp (Formerly memory.c)
* Description: Memory allocation with builtin safety checks.
* Author: Ray Smith
* Created: Wed Jan 22 09:43:33 GMT 1992
*
* (C) Copyright 1992, Hewlett-Packard Ltd.
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
** http://www.apache.org/licenses/LICENSE-2.0
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*
**********************************************************************/
#include "memry.h"
#include <stdlib.h>
// With improvements in OS memory allocators, internal memory management
// is no longer required, so all these functions now map to their malloc
// family equivalents.
// TODO(rays) further cleanup by redirecting calls to new and creating proper
// constructors.
char *alloc_string(int32_t count) {
// Round up the amount allocated to a multiple of 4
return static_cast<char*>(malloc((count + 3) & ~3));
}
void free_string(char *string) {
free(string);
}
void *alloc_mem(int32_t count) {
return malloc(static_cast<size_t>(count));
}
void free_mem(void *oldchunk) {
free(oldchunk);
}

View File

@ -1,34 +0,0 @@
/**********************************************************************
* File: memry.h (Formerly memory.h)
* Description: Header file for basic memory allocation/deallocation.
* Author: Ray Smith
* Created: Tue May 8 16:03:48 BST 1990
*
* (C) Copyright 1990, Hewlett-Packard Ltd.
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
** http://www.apache.org/licenses/LICENSE-2.0
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*
**********************************************************************/
#ifndef MEMRY_H
#define MEMRY_H
#include <cstdint>
// allocate string
extern char *alloc_string(int32_t count);
// free a string.
extern void free_string(char *string);
// get some memory
extern void *alloc_mem(int32_t count);
// free mem from alloc_mem
extern void free_mem(void *oldchunk);
#endif