2014-09-02 14:13:04 +00:00
|
|
|
/* 7zAlloc.c -- Allocation functions
|
2014-10-16 17:03:28 +00:00
|
|
|
2010-10-29 : Igor Pavlov : Public domain */
|
2014-09-02 14:13:04 +00:00
|
|
|
|
|
|
|
#include "7zAlloc.h"
|
|
|
|
|
|
|
|
void *SzAlloc(void *p, size_t size)
|
|
|
|
{
|
2015-03-16 17:26:29 +00:00
|
|
|
(void)p;
|
2014-10-16 17:03:28 +00:00
|
|
|
if (size == 0)
|
|
|
|
return 0;
|
|
|
|
return malloc(size);
|
2014-09-02 14:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SzFree(void *p, void *address)
|
|
|
|
{
|
2015-03-16 17:26:29 +00:00
|
|
|
(void)p;
|
2014-10-16 17:03:28 +00:00
|
|
|
free(address);
|
2014-09-02 14:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void *SzAllocTemp(void *p, size_t size)
|
|
|
|
{
|
2015-03-16 17:26:29 +00:00
|
|
|
(void)p;
|
2014-10-16 17:03:28 +00:00
|
|
|
if (size == 0)
|
|
|
|
return 0;
|
|
|
|
return malloc(size);
|
2014-09-02 14:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SzFreeTemp(void *p, void *address)
|
|
|
|
{
|
2015-03-16 17:26:29 +00:00
|
|
|
(void)p;
|
2014-10-16 17:03:28 +00:00
|
|
|
free(address);
|
2014-09-02 14:13:04 +00:00
|
|
|
}
|