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.

36 lines
664 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #if !defined(_STATIC_LINKED) || defined(_SHARED_LIB)
  9. #include <malloc.h>
  10. #include "vallocator.h"
  11. #include "basetypes.h"
  12. // memdbgon must be the last include file in a .cpp file!!!
  13. #include "tier0/memdbgon.h"
  14. VStdAllocator g_StdAllocator;
  15. void* VStdAllocator::Alloc(unsigned long size)
  16. {
  17. if(size)
  18. {
  19. void *ret = malloc(size);
  20. return ret;
  21. }
  22. else
  23. return 0;
  24. }
  25. void VStdAllocator::Free(void *ptr)
  26. {
  27. free(ptr);
  28. }
  29. #endif // !_STATIC_LINKED || _SHARED_LIB