FireBirdLib - Topfield TMS PVR TAP Programming Library
TAP_MemRealloc.c
Go to the documentation of this file.
1
#include "
libFireBird.h
"
2
3
void
*
TAP_MemRealloc
(
void
*ptr,
size_t
OldSize,
size_t
NewSize,
bool
InitMemory)
4
{
5
TRACEENTER
();
6
7
void
*temp;
8
9
temp = TAP_MemAlloc(NewSize);
10
if
(temp == NULL)
11
{
12
// out of memory!
13
LogEntryFBLibPrintf
(TRUE,
"TAP_MemRealloc: not enough memory (alloc returned NULL)"
);
14
15
TRACEEXIT
();
16
return
NULL;
17
}
18
19
if
(ptr && (OldSize > 0))
20
{
21
memcpy(temp, ptr, OldSize);
22
TAP_MemFree(ptr);
23
}
24
25
if
(InitMemory) memset((
byte
*) temp + OldSize, 0, NewSize - OldSize);
26
27
TRACEEXIT
();
28
return
temp;
29
}
LogEntryFBLibPrintf
void LogEntryFBLibPrintf(bool Console, char *format,...)
Definition:
LogEntryFBLibPrintf.c:13
TAP_MemRealloc
void * TAP_MemRealloc(void *ptr, size_t OldSize, size_t NewSize, bool InitMemory)
Definition:
TAP_MemRealloc.c:3
libFireBird.h
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
tap
TAP_MemRealloc.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3