This commit is contained in:
XMRig 2017-05-27 08:45:11 +03:00
parent bc2b7d1895
commit 8a70202a98

View file

@ -21,9 +21,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __MEMORY_H__
#define __MEMORY_H__
#include <stdlib.h> #include <stdlib.h>
#include <mm_malloc.h> #include <mm_malloc.h>
#include <sys/mman.h> #include <sys/mman.h>
@ -45,7 +42,7 @@ const char * persistent_memory_allocate() {
persistent_memory = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_POPULATE, 0, 0); persistent_memory = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_POPULATE, 0, 0);
if (persistent_memory == MAP_FAILED) { if (persistent_memory == MAP_FAILED) {
persistent_memory = _mm_malloc(size, 4096); persistent_memory = _mm_malloc(size, 16);
return persistent_memory; return persistent_memory;
} }
@ -77,6 +74,3 @@ void persistent_memory_free() {
_mm_free(persistent_memory); _mm_free(persistent_memory);
} }
} }
#endif /* __MEMORY_H__ */