Commit 5fa3b162 authored by Rich Prohaska's avatar Rich Prohaska

fix 32 bit arch addresses #223

git-svn-id: file:///svn/tokudb@1422 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3296a92f
...@@ -44,7 +44,12 @@ void test_cachesize() { ...@@ -44,7 +44,12 @@ void test_cachesize() {
u_int64_t s = 1; size_to(s, &gbytes, &bytes); u_int64_t s = 1; size_to(s, &gbytes, &bytes);
while (gbytes <= 32) { while (gbytes <= 32) {
r = env->set_cachesize(env, gbytes, bytes, ncache); assert(r == 0); r = env->set_cachesize(env, gbytes, bytes, ncache);
if (r != 0) {
if (verbose) printf("max %u %u\n", gbytes, bytes);
break;
}
assert(r == 0);
r = env->get_cachesize(env, &gbytes, &bytes, &ncache); assert(r == 0); r = env->get_cachesize(env, &gbytes, &bytes, &ncache); assert(r == 0);
assert(ncache == 1); assert(ncache == 1);
if (s <= minsize) if (s <= minsize)
......
...@@ -57,7 +57,7 @@ struct __toku_db_env_internal { ...@@ -57,7 +57,7 @@ struct __toku_db_env_internal {
char **data_dirs; char **data_dirs;
u_int32_t n_data_dirs; u_int32_t n_data_dirs;
//void (*noticecall)(DB_ENV *, db_notices); //void (*noticecall)(DB_ENV *, db_notices);
long cachetable_size; unsigned long cachetable_size;
CACHETABLE cachetable; CACHETABLE cachetable;
TOKULOGGER logger; TOKULOGGER logger;
}; };
...@@ -377,7 +377,11 @@ static int toku_db_env_log_flush(DB_ENV * env, const DB_LSN * lsn) { ...@@ -377,7 +377,11 @@ static int toku_db_env_log_flush(DB_ENV * env, const DB_LSN * lsn) {
} }
static int toku_db_env_set_cachesize(DB_ENV * env, u_int32_t gbytes, u_int32_t bytes, int ncache __attribute__((__unused__))) { static int toku_db_env_set_cachesize(DB_ENV * env, u_int32_t gbytes, u_int32_t bytes, int ncache __attribute__((__unused__))) {
env->i->cachetable_size = ((long) gbytes << 30) + bytes; u_int64_t cs64 = ((u_int64_t) gbytes << 30) + bytes;
unsigned long cs = cs64;
if (cs64 > cs)
return EINVAL;
env->i->cachetable_size = cs;
return 0; return 0;
} }
......
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