Silence extraneous warning, add '--mode -1' to the slotted benchmark (-1 bypasses function dispatch when setting the records)

This commit is contained in:
Sears Russell 2009-07-25 23:02:27 +00:00
parent 7f2edd880d
commit 8c012bd1c8
2 changed files with 17 additions and 1 deletions

View file

@ -10,6 +10,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stasis/transactional.h> #include <stasis/transactional.h>
#include <stasis/page/slotted.h>
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
unlink("storefile.txt"); unlink("storefile.txt");
@ -45,7 +46,20 @@ int main(int argc, char* argv[]) {
int xid = Tbegin(); int xid = Tbegin();
pageid_t page = TpageAlloc(xid); 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); Page * p = loadPage(xid, page);
writelock(p->rwlatch, 0); writelock(p->rwlatch, 0);
stasis_page_slotted_initialize_page(p); stasis_page_slotted_initialize_page(p);

View file

@ -528,8 +528,10 @@ static void slottedCleanup(Page *p) { }
void stasis_page_slotted_init() { void stasis_page_slotted_init() {
#ifdef SLOTTED_PAGE_CHECK_FOR_OVERLAP #ifdef SLOTTED_PAGE_CHECK_FOR_OVERLAP
#ifdef SLOTTED_PAGE_OLD_CHECKS
printf("slotted.c: Using expensive page sanity checking.\n"); printf("slotted.c: Using expensive page sanity checking.\n");
#endif #endif
#endif
} }
void stasis_page_slotted_deinit() { void stasis_page_slotted_deinit() {