Commit f67d6d84 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Did a {{{svn merge}}} for {{{tokudb.907}}} and deleted {{{tokudb.907}}}.

Fixes #907.


git-svn-id: file:///svn/tokudb@4524 c7de825b-a66e-492c-adef-691d508d4ae1
parent 33253ce0
...@@ -363,6 +363,10 @@ int main (int argc, const char *argv[]) { ...@@ -363,6 +363,10 @@ int main (int argc, const char *argv[]) {
extern unsigned long toku_get_maxrss(void); extern unsigned long toku_get_maxrss(void);
printf("maxrss=%.2fMB\n", toku_get_maxrss()/256.0); printf("maxrss=%.2fMB\n", toku_get_maxrss()/256.0);
} }
if (0) {
extern void print_hash_histogram (void) __attribute__((__visibility__("default")));
print_hash_histogram();
}
#endif #endif
return 0; return 0;
} }
......
...@@ -224,5 +224,11 @@ int main (int argc, const char *argv[]) { ...@@ -224,5 +224,11 @@ int main (int argc, const char *argv[]) {
ok: ok:
shutdown(); shutdown();
#ifdef TOKUDB
if (0) {
extern void print_hash_histogram (void) __attribute__((__visibility__("default")));
print_hash_histogram();
}
#endif
return 0; return 0;
} }
...@@ -66,7 +66,6 @@ BRT_SOURCES = \ ...@@ -66,7 +66,6 @@ BRT_SOURCES = \
memory \ memory \
mempool \ mempool \
omt \ omt \
primes \
recover \ recover \
roll \ roll \
toku_assert \ toku_assert \
...@@ -130,8 +129,6 @@ cachetable-test: $(OFILES) ...@@ -130,8 +129,6 @@ cachetable-test: $(OFILES)
cachetable-test2.o: cachetable.h memory.h cachetable-test2.o: cachetable.h memory.h
cachetable-test2: $(OFILES) cachetable-test2: $(OFILES)
test-primes: test-primes.o newbrt.o
test-assert: newbrt.o test-assert: newbrt.o
brtdump: $(OFILES) brtdump: $(OFILES)
......
This diff is collapsed.
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "toku_assert.h"
static int is_prime (int n) {
int i;
if (n==2) return 1;
if (n%2==0) return 0;
for (i=3; i*i<=n; i+=2) {
if (n%i==0) return 0;
}
return 1;
}
#define N_PRIMES 30
static unsigned int primes[N_PRIMES]={0};
int toku_get_prime (unsigned int idx) {
if (primes[0]==0) {
int i;
for (i=0; i<N_PRIMES; i++) {
int j;
for (j=2<<i; !is_prime(j); j++) {
}
primes[i]=j;
}
}
assert(idx<N_PRIMES);
return primes[idx];
}
void toku_test_primes (void) {
assert(toku_get_prime(0)==2);
assert(toku_get_prime(1)==5);
assert(toku_get_prime(2)==11);
assert(toku_get_prime(3)==17);
assert(toku_get_prime(4)==37);
assert(toku_get_prime(5)==67);
assert(toku_get_prime(6)==131);
}
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
/* Return the smallest prime >= 2^(idx+1)
* Only works for idx<30 */
int toku_get_prime (unsigned int idx) __attribute__((const));
void toku_test_primes(void);
...@@ -77,7 +77,6 @@ REGRESSION_TESTS = \ ...@@ -77,7 +77,6 @@ REGRESSION_TESTS = \
test-del-inorder \ test-del-inorder \
test-inc-split \ test-inc-split \
test-leafentry \ test-leafentry \
test-primes \
test_oexcl \ test_oexcl \
test_toku_malloc_plain_free \ test_toku_malloc_plain_free \
ybt-test \ ybt-test \
......
#include "primes.h"
int main() {
toku_test_primes();
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