Leaked source code of windows server 2003
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.

103 lines
2.3 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1998 **/
  4. /**********************************************************************/
  5. /*
  6. tlcach.h
  7. This module declares the private interface to the two level cache
  8. FILE HISTORY:
  9. BAlam 10-31-98 Initial Revision
  10. */
  11. #ifndef _TLCACH_H_
  12. #define _TLCACH_H_
  13. //
  14. // Default interval between adjusting the memory cache max size
  15. //
  16. #define DEFAULT_ADJUSTMENT_TIME 60000
  17. DWORD
  18. InitializeTwoLevelCache(
  19. IN DWORDLONG cbMemoryCacheSize
  20. );
  21. DWORD
  22. ReadFileIntoMemoryCache(
  23. IN HANDLE hFile,
  24. IN DWORD cbFile,
  25. OUT DWORD * pcbRequired,
  26. OUT VOID ** ppvBuffer
  27. );
  28. DWORD
  29. ReleaseFromMemoryCache(
  30. IN VOID * pvBuffer,
  31. IN DWORD cbBuffer
  32. );
  33. DWORD
  34. TerminateTwoLevelCache(
  35. VOID
  36. );
  37. DWORD
  38. DumpMemoryCacheToHtml(
  39. IN CHAR * pszBuffer,
  40. IN OUT DWORD * pcbBuffer
  41. );
  42. VOID
  43. QueryMemoryCacheStatistics(
  44. IN INETA_CACHE_STATISTICS * pCacheCtrs,
  45. IN BOOL fClearAll
  46. );
  47. #if defined(LOOKASIDE)
  48. class CLookAside
  49. {
  50. public:
  51. CLookAside(
  52. ALLOC_CACHE_CONFIGURATION* paacc,
  53. SIZE_T caacc);
  54. ~CLookAside();
  55. LPVOID
  56. Alloc(
  57. IN DWORD cbSize);
  58. BOOL
  59. Free(
  60. IN LPVOID pv,
  61. IN DWORD cbSize);
  62. protected:
  63. enum {
  64. HEAP_PREFIX = 8,
  65. HEAP_SUFFIX = 0,
  66. ACACHE_OVERHEAD = sizeof(DWORD),
  67. SIGNATURE = 'ALsT',
  68. SIGNATURE_X = 'XLsT',
  69. };
  70. int
  71. _FindAllocator(
  72. IN DWORD cbSize);
  73. DWORD m_dwSignature;
  74. ALLOC_CACHE_HANDLER** m_apach; // array of acaches
  75. ALLOC_CACHE_CONFIGURATION* m_aacc; // parallel array of config data
  76. SIZE_T m_cach; // number of acaches
  77. SIZE_T m_nMinSize;
  78. SIZE_T m_nMaxSize;
  79. };
  80. #endif // LOOKASIDE
  81. #endif