diff options
author | Sven Gothel <[email protected]> | 2011-06-07 23:39:52 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-06-07 23:39:52 +0200 |
commit | 132d4924cb191a0a16f9b42ccb718803c52b0295 (patch) | |
tree | 81dd80e6ec4f76835849b64c6dfb5a41e86dc20e /src/native/common/Platform.c | |
parent | 3c9d9db8a348eca768042140516979d32a75bffa (diff) |
Platform: Add getPageSize()
Diffstat (limited to 'src/native/common/Platform.c')
-rw-r--r-- | src/native/common/Platform.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/native/common/Platform.c b/src/native/common/Platform.c index f0e4e11..c385e12 100644 --- a/src/native/common/Platform.c +++ b/src/native/common/Platform.c @@ -3,8 +3,27 @@ #include <assert.h> +#include "com_jogamp_common_os_Platform.h" + +#if defined(_WIN32) + #include <windows.h> +#else /* assume POSIX sysconf() availability */ + #include <unistd.h> +#endif + JNIEXPORT jint JNICALL Java_com_jogamp_common_os_Platform_getPointerSizeInBitsImpl(JNIEnv *env, jclass _unused) { return sizeof(void *) * 8; } +JNIEXPORT jlong JNICALL +Java_com_jogamp_common_os_Platform_getPageSizeImpl(JNIEnv *env, jclass _unused) { +#if defined(_WIN32) + SYSTEM_INFO si; + GetSystemInfo(&si); + return (jlong) si.dwPageSize; +#else + return (jlong) sysconf(_SC_PAGESIZE); +#endif +} + |