// CodeGear C++Builder
// Copyright (c) 1995, 2021 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ABSMemory.pas' rev: 35.00 (Windows)

#ifndef AbsmemoryHPP
#define AbsmemoryHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <Winapi.Windows.hpp>
#include <ABSExcept.hpp>
#include <ABSConst.hpp>

//-- user supplied -----------------------------------------------------------

namespace Absmemory
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TABSMemoryManager;
//-- type declarations -------------------------------------------------------
typedef __int64 TABSMemorySize;

class PASCALIMPLEMENTATION TABSMemoryManager : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	__int64 FMaxMemorySize;
	__int64 FTotalMemAllocated;
	__int64 FFreeSystemMemorySize;
	__int64 FAllocMemCallCount;
	__int64 FGetMemCallCount;
	__int64 FFreeMemCallCount;
	__int64 FReallocMemCallCount;
	_RTL_CRITICAL_SECTION MMLock;
	
public:
	__fastcall TABSMemoryManager()/* overload */;
	__fastcall TABSMemoryManager(__int64 MaxMemorySize)/* overload */;
	__fastcall virtual ~TABSMemoryManager();
	void * __fastcall GetMem(__int64 BufferSize);
	void * __fastcall AllocMem(__int64 BufferSize);
	void __fastcall ReallocMem(void *Buffer, __int64 BufferSize, bool ClearTail = false);
	void __fastcall ReallocMemAndClearTail(void *Buffer, __int64 BufferSize);
	void __fastcall FreeAndNillMem(void *Buffer);
	void __fastcall FreeMem(const void * Buffer);
	__int64 __fastcall GetMemoryBufferSize(void * Buffer);
	__int64 __fastcall GetFreeMemorySize();
	__property __int64 MaxMemorySize = {read=FMaxMemorySize};
	__property __int64 TotalMemAllocated = {read=FTotalMemAllocated};
	__property __int64 AllocMemCallCount = {read=FAllocMemCallCount};
	__property __int64 GetMemCallCount = {read=FGetMemCallCount};
	__property __int64 FreeMemCallCount = {read=FFreeMemCallCount};
	__property __int64 ReallocMemCallCount = {read=FReallocMemCallCount};
};


//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE TABSMemoryManager* MemoryManager;
extern DELPHI_PACKAGE void __fastcall ABSMove(const void *Source, void *Dest, int count);
}	/* namespace Absmemory */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_ABSMEMORY)
using namespace Absmemory;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// AbsmemoryHPP
