Commit 626b865 1 parent 807b044 commit 626b865 Copy full SHA for 626b865
File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -64,14 +64,14 @@ void* Arena::alloc(size_t size)
64
64
65
65
for (auto & chunk: chunks) {
66
66
if (!chunk.second .isInUse () && size <= chunk.second .getSize ()) {
67
- char * base = chunk.first ;
67
+ char * _base = chunk.first ;
68
68
size_t leftover = chunk.second .getSize () - size;
69
69
if (leftover > 0 ) { // Split chunk
70
- chunks.emplace (base + size, Chunk (leftover, false ));
70
+ chunks.emplace (_base + size, Chunk (leftover, false ));
71
71
chunk.second .setSize (size);
72
72
}
73
73
chunk.second .setInUse (true );
74
- return reinterpret_cast <void *>(base );
74
+ return reinterpret_cast <void *>(_base );
75
75
}
76
76
}
77
77
return nullptr ;
@@ -224,6 +224,13 @@ PosixLockedPageAllocator::PosixLockedPageAllocator()
224
224
page_size = sysconf (_SC_PAGESIZE);
225
225
#endif
226
226
}
227
+
228
+ // Some systems (at least OS X) do not define MAP_ANONYMOUS yet and define
229
+ // MAP_ANON which is deprecated
230
+ #ifndef MAP_ANONYMOUS
231
+ #define MAP_ANONYMOUS MAP_ANON
232
+ #endif
233
+
227
234
void *PosixLockedPageAllocator::AllocateLocked (size_t len, bool *lockingSuccess)
228
235
{
229
236
void *addr;
You can’t perform that action at this time.
0 commit comments