CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

WWALLOC.H (2607B)


      1 //
      2 // Copyright 2020 Electronic Arts Inc.
      3 //
      4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 
      5 // software: you can redistribute it and/or modify it under the terms of 
      6 // the GNU General Public License as published by the Free Software Foundation, 
      7 // either version 3 of the License, or (at your option) any later version.
      8 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 /* $Header:   F:\projects\c&c0\vcs\code\wwalloc.h_v   4.9   07 May 1996 17:14:00   JOE_BOSTIC  $ */
     17 
     18 
     19 #ifdef __cplusplus
     20 extern "C" {
     21 #endif
     22 
     23 
     24 /*
     25 **	This should be located in the wwlib32.h file, but is located here for
     26 **	test purposes.
     27 */
     28 #ifdef __FLAT__
     29 #define	PRIVATE	static
     30 #endif
     31 
     32 typedef enum MemoryFlagType {
     33 	MEM_NORMAL = 0x0000,		// Default memory (normal).
     34 	MEM_PUBLIC = 0x0000,		// Default memory (normal).
     35 	MEM_CHIP   = 0x0000,		// Graphic & sound buffer memory (Amiga).
     36 	MEM_UNUSED = 0x0001,		// <unused>
     37 	MEM_SYSTEM = 0x0002,		// Allocate out of system heap (XMS or EMS only).
     38 	MEM_RELAXED= 0x0004,		// Don't worry about page conservation in EMS.
     39 	MEM_TEMP   = 0x0008,		// Temporary allocation (used by library only).
     40 	MEM_CLEAR  = 0x0010,		// Fill memory with '\0' characters.
     41 	MEM_PARA   = 0x0020,		// Paragraph aligned (IBM only).
     42 	MEM_XMS    = 0x0040,		// XMS memory.
     43 	MEM_EMS    = 0x0080,		// EMS memory (not implemented).
     44 	MEM_X      = 0x8000		// Here to force this enum to be unsigned sized.
     45 } MemoryFlagType;
     46 MemoryFlagType operator |(MemoryFlagType, MemoryFlagType);
     47 MemoryFlagType operator &(MemoryFlagType, MemoryFlagType);
     48 MemoryFlagType operator ~(MemoryFlagType);
     49 
     50 
     51 /* Prototypes for functions defined in this file */
     52 void *cdecl Alloc(unsigned long bytes_to_alloc, MemoryFlagType flags);
     53 void cdecl Free(void const *pointer);
     54 void *cdecl Resize_Alloc(void const *original_ptr, unsigned long new_size_in_bytes);
     55 long cdecl Ram_Free(MemoryFlagType flag);
     56 long cdecl Total_Ram_Free(MemoryFlagType flag);
     57 long cdecl Heap_Size(MemoryFlagType flag);
     58 
     59 extern unsigned long cdecl MinRam;		// Record of least memory at worst case.
     60 extern unsigned long cdecl MaxRam;		// Record of total allocated at worst case.
     61 
     62 #ifdef __cplusplus
     63 }
     64 #endif
     65