Tesseract  3.02
tesseract-ocr/cutil/freelist.cpp
Go to the documentation of this file.
00001 /**************************************************************************
00002  ** Licensed under the Apache License, Version 2.0 (the "License");
00003  ** you may not use this file except in compliance with the License.
00004  ** You may obtain a copy of the License at
00005  ** http://www.apache.org/licenses/LICENSE-2.0
00006  ** Unless required by applicable law or agreed to in writing, software
00007  ** distributed under the License is distributed on an "AS IS" BASIS,
00008  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00009  ** See the License for the specific language governing permissions and
00010  ** limitations under the License.
00011 **************************************************************************/
00012 #include "freelist.h"
00013 
00014 #include <stdlib.h>
00015 
00016 
00017 // With improvements in OS memory allocators, internal memory management is
00018 // no longer required, so these functions all map to their malloc-family
00019 // equivalents.
00020 
00021 
00022 int *memalloc(int size) {
00023   return static_cast<int*>(malloc(static_cast<size_t>(size)));
00024 }
00025 
00026 int *memrealloc(void *ptr, int size, int oldsize) {
00027   return static_cast<int*>(realloc(ptr, static_cast<size_t>(size)));
00028 }
00029 
00030 void memfree(void *element) {
00031   free(element);
00032 }