From 5ea1f630d776c7b9592cbf029e0ac2f9a220f837 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Tue, 11 Mar 2008 23:17:15 +0000 Subject: [PATCH] Fixed memory leaks. --- benchmarks/roseTableTpcCH-workload1.cpp | 8 ++++---- src/stasis/page/compression/multicolumn-impl.h | 1 + src/stasis/page/compression/pstar.h | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/benchmarks/roseTableTpcCH-workload1.cpp b/benchmarks/roseTableTpcCH-workload1.cpp index 1af6a56..8921e24 100644 --- a/benchmarks/roseTableTpcCH-workload1.cpp +++ b/benchmarks/roseTableTpcCH-workload1.cpp @@ -43,7 +43,7 @@ int main(int argc, char **argv) { using rose::Nop; int ret; // multicolumn is deprecated; want static dispatch! - + /* rose::plugin_id_t * plugins = (rose::plugin_id_t*)malloc(COLS * sizeof(rose::plugin_id_t)); // todo try Rle / For @@ -78,7 +78,7 @@ int main(int argc, char **argv) { ret = rose::main > >(argc,argv); - + */ /* return rose::main (argc,argv); */ - /* + rose::StaticMultiColumnTypePageLayout > (argc,argv); - */ + return ret; } diff --git a/src/stasis/page/compression/multicolumn-impl.h b/src/stasis/page/compression/multicolumn-impl.h index 313b3a2..824d96a 100644 --- a/src/stasis/page/compression/multicolumn-impl.h +++ b/src/stasis/page/compression/multicolumn-impl.h @@ -18,6 +18,7 @@ Multicolumn::Multicolumn(int xid, Page *p, column_number_t column_count, dispatcher_(column_count), unpacked_(1) { + stasis_page_cleanup(p_); *column_count_ptr() = column_count; diff --git a/src/stasis/page/compression/pstar.h b/src/stasis/page/compression/pstar.h index 5e02fe6..01234d7 100644 --- a/src/stasis/page/compression/pstar.h +++ b/src/stasis/page/compression/pstar.h @@ -20,6 +20,7 @@ template class Pstar { public: // Initialize a new Pstar page Pstar(int xid, Page *p): p_(p), plug_(COMPRESSOR(xid, p->memAddr)) { + stasis_page_cleanup(p); *stasis_page_type_ptr(p) = plugin_id,COMPRESSOR,TYPE>(); *freespace_ptr() = (intptr_t)recordsize_ptr() - (intptr_t)p_->memAddr; *recordsize_ptr() = sizeof(TYPE);