From 8c012bd1c81201b7ffd9b4cf4190744131757d32 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Sat, 25 Jul 2009 23:02:27 +0000 Subject: [PATCH] Silence extraneous warning, add '--mode -1' to the slotted benchmark (-1 bypasses function dispatch when setting the records) --- benchmarks/slotted.c | 16 +++++++++++++++- src/stasis/page/slotted.c | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/benchmarks/slotted.c b/benchmarks/slotted.c index 02b8c11..a92d8bb 100644 --- a/benchmarks/slotted.c +++ b/benchmarks/slotted.c @@ -10,6 +10,7 @@ #include #include +#include int main(int argc, char* argv[]) { unlink("storefile.txt"); @@ -45,7 +46,20 @@ int main(int argc, char* argv[]) { int xid = Tbegin(); pageid_t page = TpageAlloc(xid); - if(mode == 0) { + if(mode == -1) { + Page * p = loadPage(xid, page); + writelock(p->rwlatch, 0); + stasis_page_slotted_initialize_page(p); + + recordid rid = stasis_record_alloc_begin(xid, p, sizeof(uint64_t)); + stasis_record_alloc_done(xid, p, rid); + for(unsigned long long i = 0; i < count; i++) { + uint64_t val = i; + *((int*)stasis_page_slotted_record_ptr(p, rid.slot)) = val; + } + unlock(p->rwlatch); + releasePage(p); + } else if(mode == 0) { Page * p = loadPage(xid, page); writelock(p->rwlatch, 0); stasis_page_slotted_initialize_page(p); diff --git a/src/stasis/page/slotted.c b/src/stasis/page/slotted.c index 0d1b22a..05dc35d 100644 --- a/src/stasis/page/slotted.c +++ b/src/stasis/page/slotted.c @@ -528,8 +528,10 @@ static void slottedCleanup(Page *p) { } void stasis_page_slotted_init() { #ifdef SLOTTED_PAGE_CHECK_FOR_OVERLAP +#ifdef SLOTTED_PAGE_OLD_CHECKS printf("slotted.c: Using expensive page sanity checking.\n"); #endif +#endif } void stasis_page_slotted_deinit() {