Source code of Windows XP (NT5)
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.

48 lines
1.1 KiB

  1. // This is a part of the Active Template Library.
  2. // Copyright (C) 1996-2001 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Active Template Library Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Active Template Library product.
  10. #include "stdafx.h"
  11. #include "Common.h"
  12. #include "Allocate.h"
  13. #pragma warning(disable : 4074)
  14. #pragma init_seg(compiler)
  15. const char *g_pszUpdateEventName = "AtlTraceModuleManager_ProcessAddedStatic3";
  16. const char *g_pszAllocFileMapName = "AtlDebugAllocator_FileMappingNameStatic3";
  17. const char *g_pszKernelObjFmt = "%s_%0x";
  18. CAtlAllocator g_Allocator;
  19. static bool Init()
  20. {
  21. const int nSize = 64;
  22. char szFileMappingName[nSize];
  23. sprintf(szFileMappingName, g_pszKernelObjFmt,
  24. g_pszAllocFileMapName, GetCurrentProcessId());
  25. // REVIEW: surely four megs is enough?
  26. return g_Allocator.Init(szFileMappingName, 4 * 1024 * 1024);
  27. }
  28. static const bool g_bInitialized = Init();
  29. #ifdef _DEBUG
  30. namespace ATL
  31. {
  32. CTrace g_AtlTrace;
  33. };
  34. #endif