#include "Sdk/C/7zVersion.h"\r
#include "Sdk/C/LzmaDec.h"\r
\r
-extern ISzAlloc g_Alloc;\r
+/**\r
+ Allocation routine used by LZMA decompression.\r
+\r
+ @param p Pointer to the ISzAlloc instance\r
+ @param size The size in bytes to be allocated\r
+\r
+ @return The allocated pointer address, or NULL on failure\r
+**/\r
+STATIC\r
+VOID *\r
+SzAlloc (\r
+ void *p,\r
+ size_t size\r
+ )\r
+{\r
+ return AllocatePool (size);\r
+}\r
+\r
+/**\r
+ Free routine used by LZMA decompression.\r
+\r
+ @param p Pointer to the ISzAlloc instance\r
+ @param address The address to be freed\r
+**/\r
+STATIC\r
+VOID\r
+SzFree (\r
+ void *p,\r
+ void *address\r
+ )\r
+{\r
+ if (address != NULL) {\r
+ FreePool (address);\r
+ }\r
+}\r
+\r
+STATIC ISzAlloc g_Alloc = { SzAlloc, SzFree };\r
\r
#define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8)\r
\r