Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
xmrig
Commits
d92c1a54
Commit
d92c1a54
authored
5 years ago
by
XMRig
Browse files
Options
Download
Email Patches
Plain Diff
Fixed macOS build.
parent
aa474fa5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mac/memory_mac.c
+21
-2
mac/memory_mac.c
unix/memory_unix.c
+0
-4
unix/memory_unix.c
with
21 additions
and
6 deletions
+21
-6
mac/memory_mac.c
+
21
-
2
View file @
d92c1a54
...
...
@@ -4,8 +4,9 @@
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2016-2017 XMRig <support@xmrig.com>
*
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -74,3 +75,21 @@ void persistent_memory_free() {
_mm_free
(
persistent_memory
);
}
}
void
*
allocate_executable_memory
(
size_t
size
)
{
return
mmap
(
0
,
size
,
PROT_READ
|
PROT_WRITE
|
PROT_EXEC
,
MAP_PRIVATE
|
MAP_ANON
,
-
1
,
0
);
}
void
protect_executable_memory
(
void
*
p
,
size_t
size
)
{
mprotect
(
p
,
size
,
PROT_READ
|
PROT_EXEC
);
}
void
flush_instruction_cache
(
void
*
p
,
size_t
size
)
{
__builtin___clear_cache
((
char
*
)
p
,
(
char
*
)(
p
)
+
size
);
}
This diff is collapsed.
Click to expand it.
unix/memory_unix.c
+
0
-
4
View file @
d92c1a54
...
...
@@ -78,11 +78,7 @@ void persistent_memory_free() {
void
*
allocate_executable_memory
(
size_t
size
)
{
# if defined(__APPLE__)
return
mmap
(
0
,
size
,
PROT_READ
|
PROT_WRITE
|
PROT_EXEC
,
MAP_PRIVATE
|
MAP_ANON
,
-
1
,
0
);
# else
return
mmap
(
0
,
size
,
PROT_READ
|
PROT_WRITE
|
PROT_EXEC
,
MAP_PRIVATE
|
MAP_ANONYMOUS
,
-
1
,
0
);
# endif
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets