Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
951 B

  1. //====== Copyright (c), Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "stdafx.h"
  7. #include "netpacketpool.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. namespace GCSDK
  11. {
  12. CClassMemoryPool<CNetPacket> CNetPacketPool::sm_MemPoolNetPacket( k_cInitialNetworkBuffers, UTLMEMORYPOOL_GROW_FAST );
  13. static const CThreadSafeMultiMemoryPool::MemPoolConfig_t s_MemPoolConfigAllocSize[] = {
  14. { 32, 32 },
  15. { 64, 32 },
  16. { 96, 32 },
  17. { 128, 32 },
  18. { 256, 32 },
  19. { k_cubMsgSizeSmall, 32 },
  20. { 1312 /* sizeof( UDPRecvBuffer_t ) + some rounding */, 32 },
  21. { 2048, 4 },
  22. { 4096, 4 },
  23. { 16384, 4 },
  24. { 64*1024, 4 }
  25. };
  26. CThreadSafeMultiMemoryPool g_MemPoolMsg( s_MemPoolConfigAllocSize, Q_ARRAYSIZE(s_MemPoolConfigAllocSize), UTLMEMORYPOOL_GROW_FAST );
  27. // hacky global
  28. int g_cNetPacket = 0;
  29. } // namespace GCSDK