fixed bug #1005296 - NSIS build error on Linux with g++ 3.4.0
- upgraded to the latest LZMA SDK git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3638 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
ec6957f356
commit
7c6eea5d98
4 changed files with 284 additions and 0 deletions
52
Source/7zip/Common/Alloc.cpp
Normal file
52
Source/7zip/Common/Alloc.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Common/Alloc.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include "Alloc.h"
|
||||
// #include "NewHandler.h"
|
||||
|
||||
void *MyAlloc(size_t size)
|
||||
{
|
||||
return ::malloc(size);
|
||||
}
|
||||
|
||||
void MyFree(void *address)
|
||||
{
|
||||
::free(address);
|
||||
}
|
||||
|
||||
void *BigAlloc(size_t size)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return ::VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
|
||||
#else
|
||||
return ::malloc(size);
|
||||
#endif
|
||||
}
|
||||
|
||||
void BigFree(void *address)
|
||||
{
|
||||
if (address == 0)
|
||||
return;
|
||||
#ifdef WIN32
|
||||
::VirtualFree(address, 0, MEM_RELEASE);
|
||||
#else
|
||||
::free(address);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
void *BigAllocE(size_t size)
|
||||
{
|
||||
void *res = BigAlloc(size);
|
||||
#ifndef _NO_EXCEPTIONS
|
||||
if (res == 0)
|
||||
throw CNewException();
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
*/
|
Loading…
Add table
Add a link
Reference in a new issue