- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
156 lines
3.4 KiB
C++
156 lines
3.4 KiB
C++
/* malloc.h
|
|
|
|
memory management functions and variables.
|
|
|
|
*/
|
|
|
|
/*
|
|
* C/C++ Run Time Library - Version 6.5
|
|
*
|
|
* Copyright (c) 1991, 1994 by Borland International
|
|
* All Rights Reserved.
|
|
*
|
|
*/
|
|
|
|
#ifndef __MALLOC_H
|
|
#define __MALLOC_H
|
|
|
|
#include <alloc.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
#if !defined(RC_INVOKED)
|
|
|
|
#if defined(__STDC__)
|
|
#pragma warn -nak
|
|
#endif
|
|
|
|
#endif /* !RC_INVOKED */
|
|
|
|
|
|
#if !defined(__FLAT__) && !defined(__ALLOC_H)
|
|
#include <alloc.h>
|
|
#endif
|
|
|
|
|
|
#ifndef _SIZE_T
|
|
#define _SIZE_T
|
|
typedef unsigned size_t;
|
|
#endif
|
|
|
|
#if !defined(_Windows) || defined(__FLAT__)
|
|
/* _HEAPINFO structure returned by heapwalk */
|
|
|
|
|
|
#if !defined(RC_INVOKED)
|
|
#pragma option -a-
|
|
#endif
|
|
|
|
|
|
typedef struct _heapinfo
|
|
{
|
|
int *_pentry;
|
|
size_t _size;
|
|
int _useflag;
|
|
} _HEAPINFO;
|
|
|
|
|
|
#if !defined(RC_INVOKED)
|
|
#pragma option -a.
|
|
#endif
|
|
|
|
|
|
#endif /* _Windows */
|
|
|
|
|
|
#if !defined(__FLAT__)
|
|
|
|
#if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
|
|
|
|
/* Near heap functions currently allowed only in small data models */
|
|
|
|
#define _nmalloc(size) malloc(size)
|
|
#define _nfree(block) free(block)
|
|
#define _nrealloc(block,size) realloc(block,size)
|
|
#define _ncalloc(num,size) calloc(num,size)
|
|
#define _nheapmin() 0
|
|
#if !defined(_Windows)
|
|
#define _memavl() coreleft()
|
|
#endif
|
|
|
|
#endif /* small data models */
|
|
|
|
/* Model-independent functions */
|
|
|
|
#define _fmalloc(size) farmalloc((unsigned long)(size))
|
|
#define _ffree(block) farfree(block)
|
|
#define _frealloc(block,size) farrealloc(block,(unsigned long)(size))
|
|
#define _fcalloc(num,size) farcalloc((unsigned long)(num),(unsigned long)(size))
|
|
#define halloc(num,size) (void huge *)farmalloc((unsigned long)(num)*(size))
|
|
#define hfree(block) farfree((void far *)(block))
|
|
#define _heapmin() 0
|
|
#define _fheapmin() 0
|
|
|
|
#if !defined(_Windows)
|
|
int _RTLENTRY _EXPFUNC _heapwalk (_HEAPINFO *__entry);
|
|
#endif
|
|
|
|
/* Prototypes */
|
|
|
|
void * _Cdecl alloca (size_t __size);
|
|
void * _Cdecl __alloca__ (size_t __size);
|
|
|
|
#if defined(__BCOPT__ ) && !defined(_Windows)
|
|
#define alloca(__size) __alloca__(__size)
|
|
#endif
|
|
|
|
size_t _Cdecl stackavail (void);
|
|
|
|
#else /* __FLAT__ */
|
|
|
|
/* Prototypes */
|
|
|
|
void * __cdecl _EXPFUNC alloca( size_t __size );
|
|
void * __cdecl __alloca__ (size_t __size);
|
|
|
|
#if (__CGVER__ >= 0x200)
|
|
#define alloca(__size) __alloca__(__size)
|
|
#endif
|
|
|
|
size_t _RTLENTRY _EXPFUNC stackavail (void);
|
|
int _RTLENTRY _EXPFUNC _heapadd (void * __block, size_t __size);
|
|
int _RTLENTRY _EXPFUNC _heapchk (void);
|
|
int _RTLENTRY _EXPFUNC _heapmin (void);
|
|
int _RTLENTRY _EXPFUNC _heapset (unsigned int __fill);
|
|
int _RTLENTRY _EXPFUNC _heapwalk (_HEAPINFO *__entry);
|
|
int _RTLENTRY _EXPFUNC _rtl_heapwalk (_HEAPINFO *__entry);
|
|
void * _RTLENTRY _EXPFUNC _expand (void * __block, size_t __size);
|
|
size_t _RTLENTRY _EXPFUNC _msize (void * __block );
|
|
|
|
|
|
#endif /* __FLAT__ */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
/* Obsolete functions */
|
|
#if !defined(RC_INVOKED) && (!defined(_Windows) || defined(__FLAT__))
|
|
#pragma obsolete _heapwalk
|
|
#endif
|
|
|
|
|
|
#if !defined(RC_INVOKED)
|
|
|
|
#if defined(__STDC__)
|
|
#pragma warn .nak
|
|
#endif
|
|
|
|
#endif /* !RC_INVOKED */
|
|
|
|
|
|
#endif /* __MALLOC_H */
|