-
Notifications
You must be signed in to change notification settings - Fork 5
/
bmem.h
73 lines (64 loc) · 1.54 KB
/
bmem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* $Id: bmem.h,v 1.9 2009/06/02 09:41:43 bnv Exp $
* $Log: bmem.h,v $
* Revision 1.9 2009/06/02 09:41:43 bnv
* MVS/CMS corrections
*
* Revision 1.8 2008/07/15 14:54:05 bnv
* *** empty log message ***
*
* Revision 1.7 2008/07/15 07:40:07 bnv
* MVS, CMS support
*
* Revision 1.6 2008/07/14 13:09:21 bnv
* MVS,CMS support
*
* Revision 1.5 2004/08/16 15:30:15 bnv
* Added: Checking for WCE
*
* Revision 1.4 2003/02/26 16:30:16 bnv
* Added: config.h
*
* Revision 1.3 2002/06/11 12:37:56 bnv
* Added: CDECL
*
* Revision 1.2 2001/06/25 18:52:04 bnv
* Header -> Id
*
* Revision 1.1 1998/07/02 17:35:50 bnv
* Initial revision
*
*/
#ifndef __BMEM_H__
#define __BMEM_H__
#include "os.h"
#include <stdlib.h>
#if !defined(__CMS__) && !defined(__MVS__)
# include <malloc.h>
#endif
#include "config.h"
#if defined(__DEBUG__) && !defined(WCE)
# define MALLOC(s,d) mem_malloc(s,d)
# define REALLOC(p,s) mem_realloc(p,s)
# define FREE mem_free
#else
# if defined(__BORLANDC__) && (defined(__HUGE__) || defined(__LARGE__))
# define MALLOC(s,d) farmalloc(s)
# define REALLOC(p,s) farrealloc(p,s)
# define FREE farfree
# else
# define MALLOC(s, d) malloc(s)
# define REALLOC(p, s) realloc(p,s)
# define FREE free
# endif
#endif
/* ------ function prototypes --------- */
#ifdef __DEBUG__
void __CDECL *mem_malloc(size_t size, char *desc);
void __CDECL *mem_realloc(void *ptr, size_t size);
void __CDECL mem_free(void *ptr);
void __CDECL mem_list(void);
int __CDECL mem_chk(void);
long __CDECL mem_allocated(void);
#endif
#endif