📄 simplememory.h
字号:
/*
* ============================================================================
* Name : CSimpleMemory from SimpleMemory.h
* Part of : Game
* Created : 2003-06-16 by Qiu Wei Min
* Description:
* Declares main application class.
* Version :
* Copyright: Gameloft S.A.
* ============================================================================
*/
#ifndef SIMPLEMEMORY_H
#define SIMPLEMEMORY_H
// CONSTANTS
// CLASS DECLARATION
class CSimpleMemory
{
public:
static char * strcat( char *strDestination, const char *strSource );
//for GetMemType
enum {
MEM_UNKNOWN,
MEM_GLOBAL,
MEM_HEAP,
MEM_STACK
};
int GetMemType(void *p);
static char* strcpy( char *strDestination, const char *strSource );
static int strlen(const char *strDestination);
static void* Copy(void *dest, const void *src, unsigned int count);
static void* Fill( void *dest, int c, unsigned int count );
void* GlobalMalloc(int nSize);
void StackFree(void *p);
void* StackMalloc(int nSize);
void* HeapMalloc(int nSize);
void ResetStack();
void ResetHeap();
bool Init(int nGlobal, int nLocal);
bool IsInitSuccess();
CSimpleMemory();
~CSimpleMemory();
protected:
int m_nLocal, m_nGlobal;
char *m_pHeapStart, *m_pHeapCurrent;
char *m_pStackStart, *m_pStackCurrent;
char *m_pBuffer;
char *m_pGlobalCurrent;
char *m_pGlobal;
};
#endif
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -