UFO: Alien Invasion
|
Memory handling with sentinel checking and pools with tags for grouped free'ing. More...
#include "../shared/cxx.h"
Go to the source code of this file.
Macros | |
#define | Mem_CreatePool(name) _Mem_CreatePool((name),__FILE__,__LINE__) |
#define | Mem_DeletePool(pool) _Mem_DeletePool((pool),__FILE__,__LINE__) |
#define | Mem_Free(ptr) _Mem_Free((ptr),__FILE__,__LINE__) |
#define | Mem_FreeTag(pool, tagNum) _Mem_FreeTag((pool),(tagNum),__FILE__,__LINE__) |
#define | Mem_FreePool(pool) _Mem_FreePool((pool),__FILE__,__LINE__) |
#define | Mem_AllocTypeN(type, n) static_cast<type*>(Mem_Alloc(sizeof(type) * (n))) |
#define | Mem_AllocType(type) static_cast<type*>(Mem_Alloc(sizeof(type))) |
#define | Mem_Alloc(size) Mem_PoolAlloc((size), com_genericPool, 0) |
#define | Mem_PoolAlloc(size, pool, tagNum) _Mem_Alloc((size),true,(pool),(tagNum),__FILE__,__LINE__) |
#define | Mem_PoolAllocTypeN(type, n, pool) static_cast<type*>(Mem_PoolAlloc(sizeof(type) * (n), (pool), 0)) |
#define | Mem_PoolAllocType(type, pool) static_cast<type*>(Mem_PoolAllocTypeN(type, 1, (pool))) |
#define | Mem_ReAlloc(ptr, size) _Mem_ReAlloc((ptr),(size),__FILE__,__LINE__) |
#define | Mem_SafeReAlloc(ptr, size) ((ptr) ? Mem_ReAlloc(ptr, size) : Mem_Alloc(size)) |
#define | Mem_Dup(type, in, n) static_cast<type*>(_Mem_PoolDup(1 ? (in) : static_cast<type*>(0) /* type check */, sizeof(type) * (n), com_genericPool, 0, __FILE__, __LINE__)) |
#define | Mem_StrDup(in) _Mem_PoolStrDup((in),com_genericPool,0,__FILE__,__LINE__) |
#define | Mem_PoolStrDupTo(in, out, pool, tagNum) _Mem_PoolStrDupTo((in),(out),(pool),(tagNum),__FILE__,__LINE__) |
#define | Mem_PoolStrDup(in, pool, tagNum) _Mem_PoolStrDup((in),(pool),(tagNum),__FILE__,__LINE__) |
#define | Mem_PoolSize(pool) _Mem_PoolSize((pool)) |
#define | Mem_ChangeTag(pool, tagFrom, tagTo) _Mem_ChangeTag((pool),(tagFrom),(tagTo)) |
#define | Mem_CheckGlobalIntegrity() _Mem_CheckGlobalIntegrity(__FILE__,__LINE__) |
Functions | |
memPool_t * | _Mem_CreatePool (const char *name, const char *fileName, const int fileLine) __attribute__((malloc)) |
void | _Mem_DeletePool (memPool_t *pool, const char *fileName, const int fileLine) |
void | _Mem_Free (void *ptr, const char *fileName, const int fileLine) |
void | _Mem_FreeTag (memPool_t *pool, const int tagNum, const char *fileName, const int fileLine) |
Free memory blocks assigned to a specified tag within a pool. More... | |
void | _Mem_FreePool (memPool_t *pool, const char *fileName, const int fileLine) |
Free all items within a pool. More... | |
void * | _Mem_Alloc (size_t size, bool zeroFill, memPool_t *pool, const int tagNum, const char *fileName, const int fileLine) __attribute__((malloc)) |
Optionally returns 0 filled memory allocated in a pool with a tag. More... | |
void * | _Mem_ReAlloc (void *ptr, size_t size, const char *fileName, const int fileLine) |
char * | _Mem_PoolStrDupTo (const char *in, char **out, memPool_t *pool, const int tagNum, const char *fileName, const int fileLine) |
Saves a string to client hunk. More... | |
void * | _Mem_PoolDup (const void *in, size_t size, memPool_t *pool, const int tagNum, const char *fileName, const int fileLine) |
char * | _Mem_PoolStrDup (const char *in, memPool_t *pool, const int tagNum, const char *fileName, const int fileLine) __attribute__((malloc)) |
No need to null terminate the extra spot because Mem_Alloc returns zero-filled memory. More... | |
uint32_t | _Mem_PoolSize (memPool_t *pool) |
uint32_t | _Mem_ChangeTag (memPool_t *pool, const int tagFrom, const int tagTo) |
void | _Mem_CheckGlobalIntegrity (const char *fileName, const int fileLine) |
bool | _Mem_AllocatedInPool (memPool_t *pool, const void *pointer) |
void | Mem_Init (void) |
void | Mem_Shutdown (void) |
Memory handling with sentinel checking and pools with tags for grouped free'ing.
Definition in file mem.h.
#define Mem_Alloc | ( | size | ) | Mem_PoolAlloc((size), com_genericPool, 0) |
Definition at line 40 of file mem.h.
Referenced by _hash_alloc(), AllocBrush(), AllocWinding(), and CMod_LoadRouting().
Definition at line 39 of file mem.h.
Referenced by AddEpair(), AllocFace(), AllocNode(), AllocPortal(), AllocTree(), BuildLights(), BuildPatch(), CL_ActorDoMoveTime(), CL_QueueHTTPDownload(), Com_ParseFireEffect(), Com_ParseObjDefEffect(), Irc_Proto_Enqueue(), R_LoadImageData(), SEQ_AllocContext(), STRHUNK_Create(), SubdividePatch(), SV_AssembleMap_(), SV_ParallelSearch(), SV_PrintAssemblyStats(), and TEST_F().
Definition at line 38 of file mem.h.
Referenced by ASE_GetSurfaceAnimation(), ASE_KeyMESH(), ASE_Load(), BuildFacelights(), CalcLightinfoVectors(), Cbuf_AddLateCommands(), Cbuf_InsertText(), Check_ExtraBrushesForWorldspawn(), Check_FindCompositeSides(), Check_NearList(), Check_Stats(), Cmd_Exec_f(), HTTP_Recv(), Irc_Proto_Enqueue(), MakeTracingNodes(), MoveBrushesToWorld(), uiGeoscapeNode::onLoading(), PQueueInitialise(), R_CreateFramebuffer(), R_InitFBObjects(), R_SortSurfacesArrays(), Rimp_Init(), SL_SliceTheWorld(), STRHUNK_Create(), UI_ColumnLayout(), UI_TextNodeGenerateLineSplit(), and WriteTGA24().
#define Mem_ChangeTag | ( | pool, | |
tagFrom, | |||
tagTo | |||
) | _Mem_ChangeTag((pool),(tagFrom),(tagTo)) |
Definition at line 52 of file mem.h.
Referenced by R_SwitchModelMemPoolTag().
#define Mem_CheckGlobalIntegrity | ( | ) | _Mem_CheckGlobalIntegrity(__FILE__,__LINE__) |
Definition at line 54 of file mem.h.
Referenced by Qcommon_Init().
#define Mem_CreatePool | ( | name | ) | _Mem_CreatePool((name),__FILE__,__LINE__) |
Definition at line 32 of file mem.h.
Referenced by CL_InitMemPools(), CL_ParseMessageIDs(), GAME_CreatePool(), Irc_Init(), main(), Qcommon_Init(), S_Init(), EventsTest::SetUpTestCase(), ParticleTest::SetUpTestCase(), UILevel2Test::SetUpTestCase(), ScriptTest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), FootStepTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), MapDefTest::SetUpTestCase(), GameTest::SetUpTestCase(), CampaignTest::SetUpTestCase(), SV_Init(), SV_InitGameProgs(), TEST_F(), TEST_Init(), UI_Init(), and VID_Init().
#define Mem_DeletePool | ( | pool | ) | _Mem_DeletePool((pool),__FILE__,__LINE__) |
Definition at line 33 of file mem.h.
Referenced by CL_LanguageShutdown(), Irc_Shutdown(), Mem_Shutdown(), S_Shutdown(), SV_ShutdownGameProgs(), and TEST_F().
#define Mem_Dup | ( | type, | |
in, | |||
n | |||
) | static_cast<type*>(_Mem_PoolDup(1 ? (in) : static_cast<type*>(0) /* type check */, sizeof(type) * (n), com_genericPool, 0, __FILE__, __LINE__)) |
Definition at line 47 of file mem.h.
Referenced by MD2GLCmdsRemove(), MD2SkinEdit(), MD2SkinFix(), MD2SkinNum(), R_FontAnalyze(), and UI_ContainerNodeUpdateEquipment().
#define Mem_Free | ( | ptr | ) | _Mem_Free((ptr),__FILE__,__LINE__) |
Definition at line 35 of file mem.h.
Referenced by _hash_free(), ASE_FreeGeomObject(), BuildFacelights(), Cbuf_AddLateCommands(), Cbuf_InsertText(), Check_Free(), Check_InitEntityDefs(), Check_SidesOverlap(), Check_Stats(), CIN_OGM_CloseCinematic(), CIN_ROQ_CloseCinematic(), CIN_ROQ_OpenCinematic(), CL_ExecuteBattlescapeEvent(), CL_FreeBattlescapeEvent(), CL_HTTP_Cleanup(), CL_ParseFileList(), CL_SetHTTPServer(), CloseTracingNodes(), Cmd_Alias_f(), Cmd_BufClear(), Cmd_Exec_f(), Cmd_RemoveCommand(), CMod_LoadRouting(), Com_AddObjectLinks(), Com_ParseFireEffect(), Com_ParseObjDefEffect(), Com_ParseTerrain(), Com_UnregisterConstVariable(), Cvar_Delete(), Cvar_FixCheatVars(), Cvar_FullSet(), Cvar_Get(), Cvar_Reset(), Cvar_Set2(), Cvar_UnRegisterChangeListener(), uiModelNode::deleteNode(), FreeBrush(), FreeFace(), FreeInventory(), FreePatches(), FreePortal(), FreeTree(), FreeTree_r(), FreeWinding(), FS_AddGameDirectory(), FS_BuildFileList(), FS_CopyFile(), FS_GetMaps(), FS_GetModList(), FS_Shutdown(), GAME_Free(), GAME_FreeInventory(), GAME_LoadTeam(), GAME_SaveTeam(), GetToken(), HTTP_GetURL(), HTTP_Recv(), Irc_Client_CmdRplNamreply(), Irc_Logic_RemoveChannelName(), Irc_Proto_Disconnect(), Irc_Proto_DrainBucket(), Key_SetBinding(), LET_StartIdle(), LIST_Delete(), LIST_RemoveEntry(), MD2GLCmdsRemove(), MD2SkinEdit(), MD2SkinFix(), MD2SkinNum(), MoveBrushesToWorld(), NET_DatagramSocketClose(), NET_StreamClose(), NET_Wait(), PQueueFree(), R_DeleteFBObject(), R_EndBuildingLightmaps(), R_FontShutdown(), R_ImageClearMaterials(), R_LoadMaterials(), R_LoadObjModel(), R_LoadShader(), R_ModCalcUniqueNormalsAndTangents(), R_ModLoadAliasMD2MeshIndexed(), R_ModLoadAliasMD2MeshUnindexed(), R_ModReloadSurfacesArrays(), R_PreprocessShaderR(), R_RenderToTexture(), R_ScreenShot(), R_ShutdownFBObjects(), R_SoftenTexture(), R_SortSurfacesArrays(), R_UploadData(), R_UploadTexture(), S_FreeSamples(), SEQ_ExecuteDelete(), SEQ_FreeContext(), SL_SliceTheWorld(), STRHUNK_Delete(), SV_AssembleMap(), SV_AssembleMapAndTitle(), SV_DoMapAssemble(), SV_MapcycleClear(), SV_ParallelSearch(), SV_Shutdown(), TEST_F(), UI_ClearLineChart(), UI_CloneCvarOrFloat(), UI_ColumnLayout(), UI_ContainerNodeUpdateEquipment(), UI_DrawModelNode(), UI_ExecuteCallAction(), UI_FreeCvarOrFloat(), UI_FreeRadarImages(), UI_FreeStringProperty(), UI_InitializeNodeBehaviour(), UI_MaterialEditorRemoveStage_f(), UI_PopupList(), UI_RadioButton_SetValue(), UI_RemoveListener(), UI_SetOneButton(), UI_Shutdown(), UI_TextNodeGenerateLineSplit(), WriteMapFile(), and WriteTGA24().
#define Mem_FreePool | ( | pool | ) | _Mem_FreePool((pool),__FILE__,__LINE__) |
Definition at line 37 of file mem.h.
Referenced by CL_ParseMessageIDs(), CM_LoadMap(), Cmd_Shutdown(), FS_Shutdown(), GAME_FreePool(), R_ShutdownModels(), and UI_Shutdown().
#define Mem_FreeTag | ( | pool, | |
tagNum | |||
) | _Mem_FreeTag((pool),(tagNum),__FILE__,__LINE__) |
Definition at line 36 of file mem.h.
Referenced by FreeAllInventory(), GAME_FreeAllInventory(), and R_ShutdownModels().
#define Mem_PoolAlloc | ( | size, | |
pool, | |||
tagNum | |||
) | _Mem_Alloc((size),true,(pool),(tagNum),__FILE__,__LINE__) |
Definition at line 41 of file mem.h.
Referenced by _hash_alloc(), AllocInventoryMemory(), GAME_AllocInventoryMemory(), R_ModLoadAliasMD2Mesh(), and UI_AllocNodeWithoutNew().
#define Mem_PoolAllocType | ( | type, | |
pool | |||
) | static_cast<type*>(Mem_PoolAllocTypeN(type, 1, (pool))) |
Definition at line 43 of file mem.h.
Referenced by AM_CreateUnitChr(), CIN_OGM_OpenCinematic(), CIN_ROQ_OpenCinematic(), CL_ParseEvent(), CL_ParseLanguages(), CL_ParseTipOfTheDay(), uiAbstractValueNode::clone(), Cmd_AddCommand(), Cmd_Alias_f(), Com_ParseTerrain(), Com_RegisterConstInt(), Cvar_Get(), Cvar_GetChangeListener(), FS_AddGameDirectory(), FS_BuildFileList(), FS_LoadPackFile(), Irc_Logic_AddChannelName(), LIST_AllocateEntry(), LoadModel(), main(), MS_AddNewMessage(), NET_DatagramSend(), NET_DatagramSocketDoNew(), NET_StreamNew(), R_CreateSurfaceFlare(), R_LoadImageData(), R_LoadMaterials(), R_LoadObjModel(), R_LoadObjSkin(), R_LoadSurfacesArrays_(), R_SortSurfacesArrays(), S_LoadSampleIdx(), Schedule_Timer(), SV_Init(), SV_MapcycleAdd(), UI_AddListener(), UI_DrawModelNode(), UI_MaterialEditorNewStage_f(), UI_PoolAllocAction(), and UI_WindowNodeAddIndexedNode().
#define Mem_PoolAllocTypeN | ( | type, | |
n, | |||
pool | |||
) | static_cast<type*>(Mem_PoolAlloc(sizeof(type) * (n), (pool), 0)) |
Definition at line 42 of file mem.h.
Referenced by CIN_ROQ_DecodeInfo(), CL_ParseMessageIDs(), CL_ParseSequence(), CM_MakeTracingNodes(), CMod_LoadBrushes(), CMod_LoadBrushSides(), CMod_LoadLeafBrushes(), CMod_LoadLeafs(), CMod_LoadLighting(), CMod_LoadNodes(), CMod_LoadPlanes(), CMod_LoadSubmodels(), CMod_LoadSurfaces(), CP_UpdateNationXVIInfection(), FS_CopyFile(), FS_GetMaps(), FS_ListFiles(), FS_LoadFile(), FS_LoadPackFile(), GAME_LoadTeam(), GAME_SaveTeam(), uiModelNode::initNodeDynamic(), Irc_Client_CmdRplNamreply(), LIST_Add(), NET_DatagramSend(), R_BeginBuildingLightmaps(), R_BuildDefaultLightmap(), R_BuildLightmap(), R_LoadActorSkinsFromModel(), R_LoadBspVertexArrays(), R_LoadImage(), R_LoadObjModel(), R_LoadObjModelVertexArrays(), R_LoadObjSkin(), R_LoadShader(), R_LoadSurfacesArrays_(), R_ModCalcUniqueNormalsAndTangents(), R_ModLoadAliasMD2MeshIndexed(), R_ModLoadAliasMD2MeshUnindexed(), R_ModLoadAliasMD3Model(), R_ModLoadAnims(), R_ModLoadArrayData(), R_ModLoadEdges(), R_ModLoadLeafs(), R_ModLoadLighting(), R_ModLoadMDX(), R_ModLoadNodes(), R_ModLoadPlanes(), R_ModLoadSubmodels(), R_ModLoadSurfaces(), R_ModLoadSurfedges(), R_ModLoadTags(), R_ModLoadTexinfo(), R_ModLoadVertexes(), R_PreprocessShaderR(), R_RenderToTexture(), R_ScreenShot(), R_SoftenTexture(), R_SortSurfacesArrays(), R_SphereGenerate(), R_UploadData(), R_UploadTexture(), SAV_GameLoad(), SAV_GameSave(), SV_InitGame(), UI_AddLineChartLine(), UI_Init(), and UI_RegisterNodePropertyPosSize_().
#define Mem_PoolSize | ( | pool | ) | _Mem_PoolSize((pool)) |
Definition at line 51 of file mem.h.
Referenced by SV_ShutdownGameProgs().
#define Mem_PoolStrDup | ( | in, | |
pool, | |||
tagNum | |||
) | _Mem_PoolStrDup((in),(pool),(tagNum),__FILE__,__LINE__) |
Definition at line 50 of file mem.h.
Referenced by CL_AllocateActorSkin(), CL_ParseLanguages(), CL_ParseMessageID(), CL_ParseTipOfTheDay(), CL_ParticleAppear(), Cmd_Alias_f(), Cmd_TokenizeString(), Com_ParseMapDefinition(), Com_ParseTerrain(), Com_ParseUGVs(), Cvar_FixCheatVars(), Cvar_FullSet(), Cvar_Get(), Cvar_Set2(), FS_ListFiles(), GAME_PoolStrDup(), GAME_StrDup(), Key_SetBinding(), M_ParseMusic(), S_LoadSampleIdx(), SV_LoadModelAABB(), SV_MapcycleAdd(), UI_AddListener(), UI_Model_SetAnimationSource(), UI_Model_SetModelSource(), UI_Model_SetSkinSource(), UI_Model_SetTagSource(), UI_Node_SetFont(), UI_Node_SetImage(), UI_Node_SetText(), UI_Node_SetTooltip(), UI_NodeSetProperty(), UI_ParseFont(), UI_ParseUIModel(), UI_PoolAllocAction(), UI_Sequence_SetSource(), UI_SetKeyBindingEx(), UI_TBar_SetImage(), and UI_Video_SetSource().
#define Mem_PoolStrDupTo | ( | in, | |
out, | |||
pool, | |||
tagNum | |||
) | _Mem_PoolStrDupTo((in),(out),(pool),(tagNum),__FILE__,__LINE__) |
Definition at line 49 of file mem.h.
Referenced by Com_ParseBlockToken(), SEQ_ExecuteObj2D(), UI_ParseFont(), and UI_ParseUIModel().
#define Mem_ReAlloc | ( | ptr, | |
size | |||
) | _Mem_ReAlloc((ptr),(size),__FILE__,__LINE__) |
Definition at line 44 of file mem.h.
Referenced by MD2SkinNum(), PQueuePush(), and R_ModLoadAliasMD2Mesh().
#define Mem_SafeReAlloc | ( | ptr, | |
size | |||
) | ((ptr) ? Mem_ReAlloc(ptr, size) : Mem_Alloc(size)) |
Definition at line 45 of file mem.h.
Referenced by R_ReallocateStateArrays(), and R_ReallocateTexunitArray().
#define Mem_StrDup | ( | in | ) | _Mem_PoolStrDup((in),com_genericPool,0,__FILE__,__LINE__) |
Definition at line 48 of file mem.h.
Referenced by Com_ParseActorModels(), Com_ParseAircraftNames(), Com_ParseFireDefinition(), Com_ParseImplant(), Com_ParseItem(), Com_RegisterConstInt(), Cvar_Reset(), LIST_AllocateString(), ParseEpair(), ParseMapEntity(), R_ModAllocateActorSkin(), SetKeyValue(), TEST_F(), UI_AbstractValue_SetMaxCvar(), UI_AbstractValue_SetMinCvar(), UI_AbstractValue_SetRangeCvar(), UI_AbstractValue_SetValueCvar(), UI_BuildRadarImageList(), UI_GetPropertyOrLuaMethod(), UI_InitRadar(), and UI_RadioButton_SetValue().
void* _Mem_Alloc | ( | size_t | size, |
bool | zeroFill, | ||
memPool_t * | pool, | ||
const int | tagNum, | ||
const char * | fileName, | ||
const int | fileLine | ||
) |
Optionally returns 0 filled memory allocated in a pool with a tag.
Definition at line 56 of file cl_game_campaign.cpp.
References cgame_import_s::Alloc(), memBlock_t::allocFile, memBlock_t::allocLine, memPool_t::blockCount, memPool_t::blocks, memBlock_t::botSentinel, memPool_t::byteCount, cgi, Mem_BlockToFooter(), Mem_BlockToPtr(), MEM_FOOT_SENTINEL, MEM_HASH, MEM_HEAD_SENTINEL_BOT, MEM_HEAD_SENTINEL_TOP, memBlock_t::memSize, memBlock_t::next, memBlock_t::pool, memBlockFoot_t::sentinel, Sys_Error(), memBlock_t::tagNum, memBlock_t::topSentinel, UFO_SIZE_T, and z_lock.
Referenced by _Mem_PoolDup(), _Mem_PoolStrDup(), _Mem_ReAlloc(), GAME_GetImportData(), and SV_TagAlloc().
Searches a given pointer in all memory pool blocks
pool | The pool to search the pointer in |
pointer | The pointer to search in the pool |
Definition at line 482 of file mem.cpp.
References memPool_t::blocks, Mem_BlockToPtr(), MEM_HASH, memBlock_t::next, and pointer.
Referenced by UI_FreeStringProperty(), and UI_ResetData().
Definition at line 422 of file mem.cpp.
References memPool_t::blocks, MEM_HASH, and memBlock_t::next.
Definition at line 466 of file mem.cpp.
References _Mem_CheckPoolIntegrity(), i, memPool_t::inUse, and m_numPools.
Definition at line 103 of file mem.cpp.
References memPool_t::blockCount, memPool_t::blocks, memPool_t::byteCount, Com_Printf(), memPool_t::createFile, memPool_t::createLine, i, memPool_t::inUse, m_numPools, Mem_FindPool(), MEM_HASH, MEM_MAX_POOLCOUNT, MEM_MAX_POOLNAME, memPool_t::name, Q_strncpyz(), and Sys_Error().
Definition at line 146 of file mem.cpp.
References _Mem_FreePool(), memPool_t::inUse, and memPool_t::name.
Definition at line 204 of file mem.cpp.
References _Mem_CheckSentinels(), memPool_t::blockCount, memPool_t::blocks, memPool_t::byteCount, Mem_BlockRawSize(), MEM_HASH, Mem_PtrToBlock(), memBlock_t::next, memBlock_t::pool, and z_lock.
Referenced by _Mem_FreePool(), _Mem_FreeTag(), _Mem_ReAlloc(), FS_FreeFile(), and SV_MemFree().
Free all items within a pool.
Definition at line 260 of file mem.cpp.
References _Mem_Free(), memPool_t::blockCount, memPool_t::blocks, memPool_t::byteCount, Mem_BlockToPtr(), and MEM_HASH.
Referenced by _Mem_DeletePool().
Free memory blocks assigned to a specified tag within a pool.
Definition at line 241 of file mem.cpp.
References _Mem_Free(), memPool_t::blocks, Mem_BlockToPtr(), and MEM_HASH.
Referenced by SV_FreeTags().
void* _Mem_PoolDup | ( | const void * | in, |
size_t | size, | ||
memPool_t * | pool, | ||
const int | tagNum, | ||
const char * | fileName, | ||
const int | fileLine | ||
) |
Definition at line 385 of file mem.cpp.
References _Mem_Alloc().
uint32_t _Mem_PoolSize | ( | memPool_t * | pool | ) |
[in] | pool | The pool to get the size from |
Definition at line 414 of file mem.cpp.
References memPool_t::byteCount.
char* _Mem_PoolStrDup | ( | const char * | in, |
memPool_t * | pool, | ||
const int | tagNum, | ||
const char * | fileName, | ||
const int | fileLine | ||
) |
No need to null terminate the extra spot because Mem_Alloc returns zero-filled memory.
[in] | in | String to store in the given pool |
[in] | pool | The pool to allocate the memory in |
[in] | tagNum | |
[in] | fileName | The filename where this function was called from |
[in] | fileLine | The line where this function was called from |
Definition at line 403 of file mem.cpp.
References _Mem_Alloc().
Referenced by _Mem_PoolStrDupTo().
char* _Mem_PoolStrDupTo | ( | const char * | in, |
char ** | out, | ||
memPool_t * | pool, | ||
const int | tagNum, | ||
const char * | fileName, | ||
const int | fileLine | ||
) |
Saves a string to client hunk.
[in] | in | String to store in the given pool |
[out] | out | The location where you want the pool pointer to be stored |
[in] | pool | The pool to allocate the memory in |
[in] | tagNum | |
[in] | fileName | The filename where this function was called from |
[in] | fileLine | The line where this function was called from |
Definition at line 377 of file mem.cpp.
References _Mem_PoolStrDup().
Definition at line 329 of file mem.cpp.
References _Mem_Alloc(), _Mem_CheckSentinels(), _Mem_Free(), Mem_PtrToBlock(), memBlock_t::memSize, memBlock_t::pool, Sys_Error(), and memBlock_t::tagNum.
Definition at line 588 of file mem.cpp.
References Cmd_AddCommand(), and z_lock.
Referenced by main(), Qcommon_Init(), and TEST_Init().
Definition at line 603 of file mem.cpp.
References i, memPool_t::inUse, m_numPools, Mem_DeletePool, and z_lock.
Referenced by Exit(), main(), Qcommon_Shutdown(), Sys_Error(), Sys_Quit(), TEST_Shutdown(), and Usage().