Sprucing up some of alloy.

This commit is contained in:
Ben Vanik
2014-07-13 21:15:37 -07:00
parent 48425da8ff
commit 9437d0b564
40 changed files with 246 additions and 228 deletions

32
src/poly/memory.cc Normal file
View 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
View 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_

View File

@@ -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

View File

@@ -7,6 +7,8 @@
'cxx_compat.h',
'math.cc',
'math.h',
'memory.cc',
'memory.h',
'platform.h',
'poly-private.h',
'poly.cc',