Sprucing up some of alloy.
This commit is contained in:
32
src/poly/memory.cc
Normal file
32
src/poly/memory.cc
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2014 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include <poly/memory.h>
|
||||
|
||||
#if !XE_LIKE_WIN32
|
||||
#include <unistd.h>
|
||||
#endif // !XE_LIKE_WIN32
|
||||
|
||||
namespace poly {
|
||||
|
||||
size_t page_size() {
|
||||
static size_t value = 0;
|
||||
if (!value) {
|
||||
#if XE_LIKE_WIN32
|
||||
SYSTEM_INFO si;
|
||||
GetSystemInfo(&si);
|
||||
value = si.dwPageSize;
|
||||
#else
|
||||
value = getpagesize();
|
||||
#endif // XE_LIKE_WIN32
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
} // namespace poly
|
||||
22
src/poly/memory.h
Normal file
22
src/poly/memory.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2014 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef POLY_MEMORY_H_
|
||||
#define POLY_MEMORY_H_
|
||||
|
||||
#include <poly/config.h>
|
||||
#include <poly/platform.h>
|
||||
|
||||
namespace poly {
|
||||
|
||||
size_t page_size();
|
||||
|
||||
} // namespace poly
|
||||
|
||||
#endif // POLY_MEMORY_H_
|
||||
@@ -142,6 +142,7 @@ XE_CPU: 32BIT | 64BIT | BIGENDIAN | LITTLEENDIAN
|
||||
#undef min
|
||||
#undef max
|
||||
#undef Yield
|
||||
#define strdup _strdup
|
||||
#endif // WINCE || WIN32
|
||||
|
||||
#if XE_PLATFORM_XBOX360
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
'cxx_compat.h',
|
||||
'math.cc',
|
||||
'math.h',
|
||||
'memory.cc',
|
||||
'memory.h',
|
||||
'platform.h',
|
||||
'poly-private.h',
|
||||
'poly.cc',
|
||||
|
||||
Reference in New Issue
Block a user