Commit 99198867 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

imp get_max_process_data_size on windows. addresses #1387

git-svn-id: file:///svn/toku/tokudb@8748 c7de825b-a66e-492c-adef-691d508d4ae1
parent 560750bb
#define _GNU_SOURCE
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <unistd.h>
#include <assert.h>
#include <toku_portability.h>
#include <toku_os.h>
int main(void) {
uint64_t maxdata;
int r = toku_os_get_max_process_data_size(&maxdata);
assert(r == 0);
printf("maxdata=%"PRIu64"\n", maxdata);
return 0;
}
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include <inttypes.h> #include <inttypes.h>
#include <toku_portability.h>
#include <toku_os.h> #include <toku_os.h>
static void do_mallocs(void) { static void do_mallocs(void) {
......
...@@ -135,6 +135,22 @@ toku_os_gettid(void) { ...@@ -135,6 +135,22 @@ toku_os_gettid(void) {
return GetCurrentThreadId(); return GetCurrentThreadId();
} }
int
toku_os_get_max_process_data_size(uint64_t *maxdata) {
#ifdef _WIN32
// the process gets 1/2 of the 32 bit address space
*maxdata = 1ULL << 31;
return 0;
#else
#ifdef _WIN64
*maxdata = ~0ULL;
return 0;
#else
return EINVAL;
#endif
#endif
}
int int
toku_os_lock_file(char *name) { toku_os_lock_file(char *name) {
int fd = _sopen(name, O_CREAT, _SH_DENYRW, S_IREAD|S_IWRITE); int fd = _sopen(name, O_CREAT, _SH_DENYRW, S_IREAD|S_IWRITE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment