• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ MEM_ALLOC_CREDIT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MEM_ALLOC_CREDIT函数的典型用法代码示例。如果您正苦于以下问题:C++ MEM_ALLOC_CREDIT函数的具体用法?C++ MEM_ALLOC_CREDIT怎么用?C++ MEM_ALLOC_CREDIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MEM_ALLOC_CREDIT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: MEM_ALLOC_CREDIT

//-----------------------------------------------------------------------------
// Purpose: Static method
// Input  : *event - 
//			soundlist - 
//-----------------------------------------------------------------------------
void CSceneCache::PrecacheSceneEvent( CChoreoEvent *event, CUtlVector< unsigned short >& soundlist )
{
	if ( !event || event->GetType() != CChoreoEvent::SPEAK )
		return;

	int idx = soundemitterbase->GetSoundIndex( event->GetParameters() );
	if ( idx != -1 )
	{
		MEM_ALLOC_CREDIT();
		Assert( idx <= 65535 );
		soundlist.AddToTail( (unsigned short)idx );
	}

	if ( event->GetCloseCaptionType() == CChoreoEvent::CC_MASTER )
	{
		char tok[ CChoreoEvent::MAX_CCTOKEN_STRING ];
		if ( event->GetPlaybackCloseCaptionToken( tok, sizeof( tok ) ) )
		{
			int idx = soundemitterbase->GetSoundIndex( tok );
			if ( idx != -1 && soundlist.Find( idx ) == soundlist.InvalidIndex() )
			{
				MEM_ALLOC_CREDIT();
				Assert( idx <= 65535 );
				soundlist.AddToTail( (unsigned short)idx );
			}
		}
	}
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:33,代码来源:SceneCache.cpp


示例2: MEM_ALLOC_CREDIT

//-----------------------------------------------------------------------------
// Level init, shutdown
//-----------------------------------------------------------------------------
void CClientLeafSystem::LevelInitPreEntity()
{
	MEM_ALLOC_CREDIT();

	m_Renderables.EnsureCapacity( 1024 );
	m_RenderablesInLeaf.EnsureCapacity( 1024 );
	m_ShadowsInLeaf.EnsureCapacity( 256 );
	m_ShadowsOnRenderable.EnsureCapacity( 256 );
	m_DirtyRenderables.EnsureCapacity( 256 );

	// Add all the leaves we'll need
	int leafCount = engine->LevelLeafCount();
	m_Leaf.EnsureCapacity( leafCount );

	ClientLeaf_t newLeaf;
	newLeaf.m_FirstElement = m_RenderablesInLeaf.InvalidIndex();
	newLeaf.m_FirstShadow = m_ShadowsInLeaf.InvalidIndex();
	newLeaf.m_FirstDetailProp = 0;
	newLeaf.m_DetailPropCount = 0;
	newLeaf.m_DetailPropRenderFrame = -1;
	while ( --leafCount >= 0 )
	{
		m_Leaf.AddToTail( newLeaf );
	}
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:28,代码来源:clientleafsystem.cpp


示例3: AUTO_LOCK_

void virtualmodel_t::AppendModels( int group, const studiohdr_t *pStudioHdr )
{
	AUTO_LOCK_( CThreadTerminalMutex<CThreadFastMutex>, m_Lock );

	// build a search table if necesary
	CModelLookupContext ctx(group, pStudioHdr);

	AppendSequences( group, pStudioHdr );
	AppendAnimations( group, pStudioHdr );
	AppendBonemap( group, pStudioHdr );
	AppendAttachments( group, pStudioHdr );
	AppendPoseParameters( group, pStudioHdr );
	AppendNodes( group, pStudioHdr );
	AppendIKLocks( group, pStudioHdr );

	struct HandleAndHeader_t
	{
		void				*handle;
		const studiohdr_t	*pHdr;
	};
	HandleAndHeader_t list[64];

	// determine quantity of valid include models in one pass only
	// temporarily cache results off, otherwise FindModel() causes ref counting problems
	int j;
	int nValidIncludes = 0;
	for (j = 0; j < pStudioHdr->numincludemodels; j++)
	{
		// find model (increases ref count)
		void *tmp = NULL;
		const studiohdr_t *pTmpHdr = pStudioHdr->FindModel( &tmp, pStudioHdr->pModelGroup( j )->pszName() );
		if ( pTmpHdr )
		{
			if ( nValidIncludes >= ARRAYSIZE( list ) )
			{
				// would cause stack overflow
				Assert( 0 );
				break;
			}

			list[nValidIncludes].handle = tmp;
			list[nValidIncludes].pHdr = pTmpHdr;
			nValidIncludes++;
		}
	}

	if ( nValidIncludes )
	{
		m_group.EnsureCapacity( m_group.Count() + nValidIncludes );
		for (j = 0; j < nValidIncludes; j++)
		{
			MEM_ALLOC_CREDIT();
			int group = m_group.AddToTail();
			m_group[group].cache = list[j].handle;
			AppendModels( group, list[j].pHdr );
		}
	}

	UpdateAutoplaySequences( pStudioHdr );
}
开发者ID:emcniece,项目名称:fps-moba,代码行数:60,代码来源:studio_virtualmodel.cpp


示例4: EntityChanged

	void EntityChanged( CBaseEntity *pEntity )
	{
		// might change after deletion, don't put back into the list
		if ( pEntity->IsMarkedForDeletion() )
			return;
		
		const CBaseHandle &eh = pEntity->GetRefEHandle();
		if ( !eh.IsValid() )
			return;

		int index = eh.GetEntryIndex();
		// UNDONE: Maintain separate lists for "no think/no sim" and just "no sim"
		// UNDONE: Keep "no sim" list sorted by thinktime
		// UNDONE: Add query for "no sim" list that includes a time and just get ents that will think by that time
		if ( pEntity->IsEFlagSet( EFL_NO_THINK_FUNCTION ) && pEntity->IsEFlagSet( EFL_NO_GAME_PHYSICS_SIMULATION ) )
		{
			Assert( !pEntity->IsPlayer() );
			RemoveEntinfoIndex( index );
		}
		else
		{
			// already in the list? (had think or sim last time, now has both - or had both last time, now just one)
			if ( m_entinfoIndex[index] == 0xFFFF )
			{
				MEM_ALLOC_CREDIT();
				m_entinfoIndex[index] = m_simThinkList.AddToTail( (unsigned short)index );
			}
		}
	}
开发者ID:paralin,项目名称:hl2sdk,代码行数:29,代码来源:entitylist.cpp


示例5: Draw_DecalSetName

void Draw_DecalSetName( int decal, char *name )
{
	while ( decal >= g_DecalLookup.Count() )
	{
		MEM_ALLOC_CREDIT();
		int idx = g_DecalLookup.AddToTail();
		g_DecalLookup[idx] = g_DecalDictionary.InvalidIndex();
	}

	FileNameHandle_t fnHandle = g_pFileSystem->FindOrAddFileName( name );
	int lookup = g_DecalDictionary.Find( fnHandle );
	if ( lookup == g_DecalDictionary.InvalidIndex() )
	{
		DecalEntry entry;
#ifdef _DEBUG
		int len = strlen(name) + 1;
		entry.m_pDebugName = new char[len];
		memcpy( entry.m_pDebugName, name, len );
#endif
		entry.material = GL_LoadMaterial( name, TEXTURE_GROUP_DECAL );
		entry.index = decal;

		lookup = g_DecalDictionary.Insert( fnHandle, entry );
	}
	else
	{
		g_DecalDictionary[lookup].index = decal;
	}

	g_DecalLookup[decal] = lookup;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:31,代码来源:decals.cpp


示例6: MEM_ALLOC_CREDIT

void CGameUI2::Initialize(CreateInterfaceFn appFactory)
{
	MEM_ALLOC_CREDIT();
	ConnectTier1Libraries(&appFactory, 1);
	ConnectTier2Libraries(&appFactory, 1);
	ConVar_Register(FCVAR_CLIENTDLL);
	ConnectTier3Libraries(&appFactory, 1);

	engine = static_cast<IVEngineClient*>(appFactory(VENGINE_CLIENT_INTERFACE_VERSION, nullptr));
	enginesound = static_cast<IEngineSound*>(appFactory(IENGINESOUND_CLIENT_INTERFACE_VERSION, nullptr));
	enginevgui = static_cast<IEngineVGui*>(appFactory(VENGINE_VGUI_VERSION, nullptr));
	soundemitterbase = static_cast<ISoundEmitterSystemBase*>(appFactory(SOUNDEMITTERSYSTEM_INTERFACE_VERSION, nullptr));
	render = static_cast<IVRenderView*>(appFactory(VENGINE_RENDERVIEW_INTERFACE_VERSION, nullptr));

	CreateInterfaceFn gameUIFactory = g_GameUI.GetFactory();
	if (gameUIFactory)
		gameui = static_cast<IGameUI*>(gameUIFactory(GAMEUI_INTERFACE_VERSION, nullptr));

	if (!enginesound || !enginevgui || !engine || !soundemitterbase || !render || !gameui)
		Error("CGameUI2::Initialize() failed to get necessary interfaces.\n");

    if (!CommandLine()->FindParm("-shaderedit"))
    {
        GetBasePanel()->Create();
        if (GetBasePanel())
            gameui->SetMainMenuOverride(GetBasePanel()->GetMainMenu()->GetVPanel());
    }
}
开发者ID:Asunaya,项目名称:game,代码行数:28,代码来源:gameui2_interface.cpp


示例7: PhysicsLevelInit

void PhysicsLevelInit( void )
{
	physenv = physics->CreateEnvironment();
	assert( physenv );
#ifdef PORTAL
	physenv_main = physenv;
#endif
	{
	MEM_ALLOC_CREDIT();
	g_EntityCollisionHash = physics->CreateObjectPairHash();
	}

	// TODO: need to get the right factory function here
	//physenv->SetDebugOverlay( appSystemFactory );
	physenv->SetGravity( Vector(0, 0, -sv_gravity.GetFloat() ) );
	physenv->SetAlternateGravity( Vector(0, 0, -cl_ragdoll_gravity.GetFloat() ) );
	
	// NOTE: Always run client physics at a rate >= 45Hz - helps keep ragdolls stable
	const float defaultPhysicsTick = 1.0f / 60.0f; // 60Hz to stay in sync with x360 framerate of 30Hz
	physenv->SetSimulationTimestep( defaultPhysicsTick );
	physenv->SetCollisionEventHandler( &g_Collisions );
	physenv->SetCollisionSolver( &g_Collisions );

	C_World *pWorld = GetClientWorldEntity();
	g_PhysWorldObject = PhysCreateWorld_Shared( pWorld, modelinfo->GetVCollide(1), g_PhysDefaultObjectParams );

	staticpropmgr->CreateVPhysicsRepresentations( physenv, &g_SolidSetup, pWorld );
}
开发者ID:SCell555,项目名称:hl2-asw-port,代码行数:28,代码来源:physics.cpp


示例8: PhysicsLevelInit

void PhysicsLevelInit( void )
{
	physenv = physics->CreateEnvironment();
	assert( physenv );
#ifdef PORTAL
	physenv_main = physenv;
#endif
	{
	MEM_ALLOC_CREDIT();
	g_EntityCollisionHash = physics->CreateObjectPairHash();
	}

	// TODO: need to get the right factory function here
	//physenv->SetDebugOverlay( appSystemFactory );
	physenv->SetGravity( Vector(0, 0, -sv_gravity.GetFloat() ) );
	// 15 ms per tick
	// NOTE: Always run client physics at this rate - helps keep ragdolls stable
	physenv->SetSimulationTimestep( IsXbox() ? DEFAULT_XBOX_CLIENT_VPHYSICS_TICK : DEFAULT_TICK_INTERVAL );
	physenv->SetCollisionEventHandler( &g_Collisions );
	physenv->SetCollisionSolver( &g_Collisions );

	g_PhysWorldObject = PhysCreateWorld_Shared( GetClientWorldEntity(), modelinfo->GetVCollide(1), g_PhysDefaultObjectParams );

	staticpropmgr->CreateVPhysicsRepresentations( physenv, &g_SolidSetup, NULL );
}
开发者ID:KyleGospo,项目名称:City-17-Episode-One-Source,代码行数:25,代码来源:physics.cpp


示例9: MEM_ALLOC_CREDIT

void CBaseGameStats_Driver::PossibleMapChange( void )
{
#ifdef GAME_DLL
	//detect and copy map changes
	if ( Q_stricmp( m_PrevMapName.String(), STRING( gpGlobals->mapname ) ) )
	{
		MEM_ALLOC_CREDIT();

		CUtlString PrevMapBackup = m_PrevMapName;

		m_PrevMapName = STRING( gpGlobals->mapname );

		gamestats->Event_MapChange( PrevMapBackup.String(), STRING( gpGlobals->mapname ) );

		if ( gamestats->UseOldFormat() )
		{
			if( gamestats->AutoSave_OnMapChange() )
				gamestats->SaveToFileNOW();

			if( gamestats->AutoUpload_OnMapChange() )
				gamestats->UploadStatsFileNOW();
		}
	}
#endif
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:25,代码来源:gamestats.cpp


示例10: SortSpawnListByHierarchy

static void SortSpawnListByHierarchy( int nEntities, HierarchicalSpawn_t *pSpawnList )
{
	MEM_ALLOC_CREDIT();
	g_pClassnameSpawnPriority = new CStringRegistry;
	// this will cause the entities to be spawned in the indicated order
	// Highest string ID spawns first.  String ID is spawn priority.
	// by default, anything not in this list has priority -1
	g_pClassnameSpawnPriority->AddString( "func_wall", 10 );
	g_pClassnameSpawnPriority->AddString( "scripted_sequence", 9 );
	g_pClassnameSpawnPriority->AddString( "phys_hinge", 8 );
	g_pClassnameSpawnPriority->AddString( "phys_ballsocket", 8 );
	g_pClassnameSpawnPriority->AddString( "phys_slideconstraint", 8 );
	g_pClassnameSpawnPriority->AddString( "phys_constraint", 8 );
	g_pClassnameSpawnPriority->AddString( "phys_pulleyconstraint", 8 );
	g_pClassnameSpawnPriority->AddString( "phys_lengthconstraint", 8 );
	g_pClassnameSpawnPriority->AddString( "phys_ragdollconstraint", 8 );
	g_pClassnameSpawnPriority->AddString( "info_mass_center", 8 ); // spawn these before physbox/prop_physics
	g_pClassnameSpawnPriority->AddString( "trigger_vphysics_motion", 8 ); // spawn these before physbox/prop_physics

	g_pClassnameSpawnPriority->AddString( "prop_physics", 7 );
	g_pClassnameSpawnPriority->AddString( "prop_ragdoll", 7 );
	// Sort the entities (other than the world) by hierarchy depth, in order to spawn them in
	// that order. This insures that each entity's parent spawns before it does so that
	// it can properly set up anything that relies on hierarchy.
#ifdef _WIN32
	qsort(&pSpawnList[0], nEntities, sizeof(pSpawnList[0]), (int (__cdecl *)(const void *, const void *))CompareSpawnOrder);
#elif POSIX
	qsort(&pSpawnList[0], nEntities, sizeof(pSpawnList[0]), (int (*)(const void *, const void *))CompareSpawnOrder);
#endif
	delete g_pClassnameSpawnPriority;
	g_pClassnameSpawnPriority = NULL;
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:32,代码来源:mapentities.cpp


示例11: Assert

//-----------------------------------------------------------------------------
// Purpose: Add an activity to the activity string registry and increment
//			the acitivty counter
//-----------------------------------------------------------------------------
void CAI_BaseNPC::AddActivityToSR(const char *actName, int actID) 
{
	Assert( m_pActivitySR );
	if ( !m_pActivitySR )
		return;

	// technically order isn't dependent, but it's too damn easy to forget to add new ACT_'s to all three lists.

	// NOTE: This assertion generally means that the activity enums are out of order or that new enums were not added to all
	//		 relevant tables.  Make sure that you have included all new enums in:
	//			game_shared/ai_activity.h
	//			game_shared/activitylist.cpp
	//			dlls/ai_activity.cpp
	MEM_ALLOC_CREDIT();

	static int lastActID = -2;
	Assert( actID >= LAST_SHARED_ACTIVITY || actID == lastActID + 1 || actID == ACT_INVALID );
	lastActID = actID;

	if ( m_pActivitySR->GetStringID( actName ) != -1 )
	{
		printf( "Duplicate\n" );
	}

	m_pActivitySR->AddString(actName, actID);
	m_iNumActivities++;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:31,代码来源:ai_activity.cpp


示例12: MEM_ALLOC_CREDIT

void CUtlBinaryBlock::SetLength( int nLength )
{
	MEM_ALLOC_CREDIT();
	Assert( !m_Memory.IsReadOnly() );

	m_nActualLength = nLength;
	if ( nLength > m_Memory.NumAllocated() )
	{
		int nOverFlow = nLength - m_Memory.NumAllocated();
		m_Memory.Grow( nOverFlow );

		// If the reallocation failed, clamp length
		if ( nLength > m_Memory.NumAllocated() )
		{
			m_nActualLength = m_Memory.NumAllocated();
		}
	}

#ifdef _DEBUG
	if ( m_Memory.NumAllocated() > m_nActualLength )
	{
		memset( ( ( char * )m_Memory.Base() ) + m_nActualLength, 0xEB, m_Memory.NumAllocated() - m_nActualLength );
	}
#endif
}
开发者ID:Baer42,项目名称:source-sdk-2013,代码行数:25,代码来源:utlstring.cpp


示例13: ClearKeyValuesCache

void ClearKeyValuesCache()
{
	MEM_ALLOC_CREDIT();
	for ( int i=g_KeyValuesCache.First(); i != g_KeyValuesCache.InvalidIndex(); i=g_KeyValuesCache.Next( i ) )
	{
		g_KeyValuesCache[i]->deleteThis();
	}
	g_KeyValuesCache.Purge();
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:9,代码来源:c_vguiscreen.cpp


示例14: ReloadParticleEffectsInList

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void ReloadParticleEffectsInList( IFileList *pFilesToReload )
{
	MEM_ALLOC_CREDIT();

	CUtlVector<CUtlString> files;
	GetParticleManifest( files );

	// CAB 2/17/11 Reload all the particles regardless (Fixes filename change exploits).
	bool bReloadAll = true;

	//int nCount = files.Count();
	//for ( int i = 0; i < nCount; ++i )
	//{
	//	// Skip the precache marker
	//	const char *pFile = files[i];
 //		if ( pFile[0] == '!' )
 //		{
 //			pFile++;
 //		}

	//	char szDX80Filename[MAX_PATH];
	//	V_strncpy( szDX80Filename, pFile, sizeof( szDX80Filename ) );
	//	V_StripExtension( pFile, szDX80Filename, sizeof( szDX80Filename ) );
	//	V_strncat( szDX80Filename, "_dx80.", sizeof( szDX80Filename ) );
	//	V_strncat( szDX80Filename, V_GetFileExtension( pFile ), sizeof( szDX80Filename ) );

	//	if ( pFilesToReload->IsFileInList( pFile ) || pFilesToReload->IsFileInList( szDX80Filename ) )
	//	{
	//		Msg( "Reloading all particle files due to pure settings.\n" );
	//		bReloadAll = true;
	//		break;
	//	}
	//}

	// Then check to see if we need to reload the map's particles
	const char *pszMapName = NULL;
#ifdef CLIENT_DLL
	pszMapName = engine->GetLevelName();	
#else
	pszMapName = STRING( gpGlobals->mapname );
#endif
	if ( pszMapName && pszMapName[0] )
	{
		char mapname[MAX_MAP_NAME];
		Q_FileBase( pszMapName, mapname, sizeof( mapname ) );
		Q_strlower( mapname );
		ParseParticleEffectsMap( mapname, true, pFilesToReload );
	}

	if ( bReloadAll )
	{
		ParseParticleEffects( true, true );
	}
	
	g_pParticleSystemMgr->DecommitTempMemory();
}
开发者ID:staticfox,项目名称:TF2Classic,代码行数:59,代码来源:particle_parse.cpp


示例15: MEM_ALLOC_CREDIT

void CGameUI::SendConnectedToGameMessage()
{
	MEM_ALLOC_CREDIT();
	KeyValues *kv = new KeyValues( "ConnectedToGame" );
	kv->SetInt( "ip", m_iGameIP );
	kv->SetInt( "connectionport", m_iGameConnectionPort );
	kv->SetInt( "queryport", m_iGameQueryPort );

	g_VModuleLoader.PostMessageToAllModules( kv );
}
开发者ID:DonnaLisa,项目名称:swarm-deferred,代码行数:10,代码来源:gameui_interface.cpp


示例16: MEM_ALLOC_CREDIT

//-----------------------------------------------------------------------------
// Purpose: Static method
// Input  : sounds - 
//			*soundname - 
//-----------------------------------------------------------------------------
void CModelSoundsCache::FindOrAddScriptSound( CUtlVector< unsigned short >& sounds, char const *soundname )
{
	int soundindex = soundemitterbase->GetSoundIndex( soundname );
	if ( soundindex != -1 )
	{
		// Only add it once per model...
		if ( sounds.Find( soundindex ) == sounds.InvalidIndex() )
		{
			MEM_ALLOC_CREDIT();
			sounds.AddToTail( soundindex );
		}
	}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:18,代码来源:ModelSoundsCache.cpp


示例17: MEM_ALLOC_CREDIT

//-----------------------------------------------------------------------------
// Loads up a file containing metaclass definitions
//-----------------------------------------------------------------------------
void CPanelMetaClassMgrImp::LoadMetaClassDefinitionFile( const char *pFileName )
{
	MEM_ALLOC_CREDIT();

	// Blat out previous metaclass definitions read in from this file...
	int i = m_MetaClassKeyValues.Find( pFileName );
	if (i != m_MetaClassKeyValues.InvalidIndex() )
	{
		// Blow away the previous keyvalues	from that file
		unsigned short j = m_MetaClassDict.First();
		while ( j != m_MetaClassDict.InvalidIndex() )
		{
			unsigned short next = m_MetaClassDict.Next(j);
			if ( m_MetaClassDict[j].m_KeyValueIndex == i)
			{
				m_MetaClassDict.RemoveAt(j);
			}

			j = next;
		}

		m_MetaClassKeyValues[i]->deleteThis();
		m_MetaClassKeyValues.RemoveAt(i); 
	}

	// Create a new keyvalues entry
	KeyValues* pKeyValues = new KeyValues(pFileName);
	int idx = m_MetaClassKeyValues.Insert( pFileName, pKeyValues );

	// Read in all metaclass definitions...

	// Load the file
	if ( !pKeyValues->LoadFromFile( filesystem, pFileName ) )
	{
		Warning( "Couldn't find metaclass definition file %s\n", pFileName );
		pKeyValues->deleteThis();
		m_MetaClassKeyValues.RemoveAt(idx);
		return;
	}
	else
	{
		// Go ahead and parse the data now
		if ( !ParseMetaClassList( pFileName, pKeyValues, idx ) )
		{
			Warning( "Detected one or more errors parsing %s\n", pFileName );
		}
	}
}
开发者ID:newroob,项目名称:bg2-2007,代码行数:51,代码来源:panelmetaclassmgr.cpp


示例18: CacheKeyValuesForFile

KeyValues* CacheKeyValuesForFile( const char *pFilename )
{
	MEM_ALLOC_CREDIT();
	int i = g_KeyValuesCache.Find( pFilename );
	if ( i == g_KeyValuesCache.InvalidIndex() )
	{
		KeyValues *rDat = new KeyValues( pFilename );
		rDat->LoadFromFile( filesystem, pFilename, NULL );
		g_KeyValuesCache.Insert( pFilename, rDat );
		return rDat;		
	}
	else
	{
		return g_KeyValuesCache[i];
	}
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:16,代码来源:c_vguiscreen.cpp


示例19: MEM_ALLOC_CREDIT

void CAI_GlobalNamespace::AddSymbol( const char *pszSymbol, int symbolID )
{
	MEM_ALLOC_CREDIT();
	AssertMsg( symbolID != -1, "Invalid symbol id passed to CAI_GlobalNamespace::AddSymbol()" );
	if (symbolID == -1 )
		return;

	AssertMsg( AI_IdIsGlobal( symbolID ), ("Local symbol ID passed to CAI_GlobalNamespace::AddSymbol()") );
	AssertMsg( !IdToSymbol( symbolID ) , ("Duplicate symbol ID passed to CAI_GlobalNamespace::AddSymbol()") );
	AssertMsg( SymbolToId( pszSymbol ) == -1, ("Duplicate symbol passed to CAI_GlobalNamespace::AddSymbol()") );

	m_pSymbols->AddString( pszSymbol, symbolID );

	if ( m_NextGlobalBase < symbolID + 1 )
		m_NextGlobalBase = symbolID + 1;
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:16,代码来源:ai_namespaces.cpp


示例20: MEM_ALLOC_CREDIT

CCountedStringPool::CCountedStringPool()
{
	MEM_ALLOC_CREDIT();
	m_HashTable.EnsureCount(HASH_TABLE_SIZE);

	for( int i = 0; i < m_HashTable.Count(); i++ )
	{
		m_HashTable[i] = INVALID_ELEMENT;		
	}

	m_FreeListStart = INVALID_ELEMENT;
	m_Elements.AddToTail();
	m_Elements[0].pString = NULL;
	m_Elements[0].nReferenceCount = 0;
	m_Elements[0].nNextElement = INVALID_ELEMENT;
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:16,代码来源:stringpool.cpp



注:本文中的MEM_ALLOC_CREDIT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MEM_CHECK函数代码示例发布时间:2022-05-30
下一篇:
C++ MEM_ALIGN函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap