Commit 88d5b76b authored by Rich Prohaska's avatar Rich Prohaska

#17 fix a memory leak

parent 3c9a0435
...@@ -29,6 +29,8 @@ list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ...@@ -29,6 +29,8 @@ list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
ydb/loader-cleanup-test3.tdb ydb/loader-cleanup-test3.tdb
ydb/loader-stress-test4.tdb ydb/loader-stress-test4.tdb
ydb/maxsize-for-loader-B.tdb ydb/maxsize-for-loader-B.tdb
ydb/openlimit17.tdb
ydb/openlimit17-locktree.tdb
ydb/preload-db-nested.tdb ydb/preload-db-nested.tdb
ydb/stress-gc.tdb ydb/stress-gc.tdb
ydb/stress-gc2.tdb ydb/stress-gc2.tdb
......
...@@ -300,6 +300,8 @@ toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, bool create) ...@@ -300,6 +300,8 @@ toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, bool create)
bool is_empty; bool is_empty;
is_empty = toku_ft_is_empty_fast(t); is_empty = toku_ft_is_empty_fast(t);
assert(is_empty); assert(is_empty);
} else {
toku_ft_handle_close(t);
} }
return r; return r;
} }
......
...@@ -140,7 +140,7 @@ int test_main (int argc __attribute__((__unused__)), char *const argv[] __attrib ...@@ -140,7 +140,7 @@ int test_main (int argc __attribute__((__unused__)), char *const argv[] __attrib
for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) {
dbs[i] = NULL; dbs[i] = NULL;
} }
bool emfile_happened = false; bool emfile_happened = false; // should happen since there are less than N unused file descriptors
for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) {
r = db_create(&dbs[i], env, 0); r = db_create(&dbs[i], env, 0);
assert(r == 0); assert(r == 0);
......
...@@ -109,11 +109,9 @@ int test_main (int argc __attribute__((__unused__)), char *const argv[] __attrib ...@@ -109,11 +109,9 @@ int test_main (int argc __attribute__((__unused__)), char *const argv[] __attrib
r = env->close(env, 0); r = env->close(env, 0);
assert(r == 0); assert(r == 0);
struct rlimit nofile_limit; struct rlimit nofile_limit;
r = getrlimit(RLIMIT_NOFILE, &nofile_limit); r = getrlimit(RLIMIT_NOFILE, &nofile_limit);
assert(r == 0); assert(r == 0);
const int N = 100; const int N = 100;
nofile_limit.rlim_cur = N; nofile_limit.rlim_cur = N;
r = setrlimit(RLIMIT_NOFILE, &nofile_limit); r = setrlimit(RLIMIT_NOFILE, &nofile_limit);
......
...@@ -96,7 +96,7 @@ PATENT RIGHTS GRANT: ...@@ -96,7 +96,7 @@ PATENT RIGHTS GRANT:
int test_main (int argc __attribute__((__unused__)), char *const argv[] __attribute__((__unused__))) { int test_main (int argc __attribute__((__unused__)), char *const argv[] __attribute__((__unused__))) {
int r; int r;
const int N = 100; const int N = 200;
struct rlimit nofile_limit = { N, N }; struct rlimit nofile_limit = { N, N };
r = setrlimit(RLIMIT_NOFILE, &nofile_limit); r = setrlimit(RLIMIT_NOFILE, &nofile_limit);
...@@ -120,7 +120,7 @@ int test_main (int argc __attribute__((__unused__)), char *const argv[] __attrib ...@@ -120,7 +120,7 @@ int test_main (int argc __attribute__((__unused__)), char *const argv[] __attrib
for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) {
dbs[i] = NULL; dbs[i] = NULL;
} }
bool emfile_happened = false; bool emfile_happened = false; // should happen since there are less than N unused file descriptors
for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) {
r = db_create(&dbs[i], env, 0); r = db_create(&dbs[i], env, 0);
assert(r == 0); assert(r == 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