Alloc.h 638 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Alloc.h -- Memory allocation functions
  2. 2015-02-21 : Igor Pavlov : Public domain */
  3. #ifndef __COMMON_ALLOC_H
  4. #define __COMMON_ALLOC_H
  5. #include "7zTypes.h"
  6. EXTERN_C_BEGIN
  7. void *MyAlloc(size_t size);
  8. void MyFree(void *address);
  9. #ifdef _WIN32
  10. void SetLargePageSize();
  11. void *MidAlloc(size_t size);
  12. void MidFree(void *address);
  13. void *BigAlloc(size_t size);
  14. void BigFree(void *address);
  15. #else
  16. #define MidAlloc(size) MyAlloc(size)
  17. #define MidFree(address) MyFree(address)
  18. #define BigAlloc(size) MyAlloc(size)
  19. #define BigFree(address) MyFree(address)
  20. #endif
  21. extern ISzAlloc g_Alloc;
  22. extern ISzAlloc g_BigAlloc;
  23. EXTERN_C_END
  24. #endif