tesseract
3.05.02
freelist.cpp
Go to the documentation of this file.
1
/**************************************************************************
2
** Licensed under the Apache License, Version 2.0 (the "License");
3
** you may not use this file except in compliance with the License.
4
** You may obtain a copy of the License at
5
** http://www.apache.org/licenses/LICENSE-2.0
6
** Unless required by applicable law or agreed to in writing, software
7
** distributed under the License is distributed on an "AS IS" BASIS,
8
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
** See the License for the specific language governing permissions and
10
** limitations under the License.
11
**************************************************************************/
12
#include "
freelist.h
"
13
14
#include <stdlib.h>
15
16
17
// With improvements in OS memory allocators, internal memory management is
18
// no longer required, so these functions all map to their malloc-family
19
// equivalents.
20
21
22
int
*
memalloc
(
int
size) {
23
return
static_cast<
int
*
>
(malloc(static_cast<size_t>(size)));
24
}
25
26
int
*
memrealloc
(
void
*ptr,
int
size,
int
oldsize) {
27
return
static_cast<
int
*
>
(realloc(ptr, static_cast<size_t>(size)));
28
}
29
30
void
memfree
(
void
*element) {
31
free(element);
32
}
freelist.h
memfree
void memfree(void *element)
Definition:
freelist.cpp:30
memalloc
int * memalloc(int size)
Definition:
freelist.cpp:22
memrealloc
int * memrealloc(void *ptr, int size, int oldsize)
Definition:
freelist.cpp:26
cutil
freelist.cpp
Generated on Mon Oct 29 2018 11:27:50 for tesseract by
1.8.14