Fixed memory leaks.

This commit is contained in:
Sears Russell 2008-03-11 23:17:15 +00:00
parent 474670092e
commit 5ea1f630d7
3 changed files with 6 additions and 4 deletions

View file

@ -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
<rose::DynamicMultiColumnTypePageLayout<rose::Multicolumn<tup> > >(argc,argv);
*/
/* return rose::main
<rose::MultiColumnTypePageLayout
<COLS,
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
>
(argc,argv);
*/
/*
rose::StaticMultiColumnTypePageLayout
<COLS,
rose::StaticMulticolumn<COLS,tup,
@ -127,6 +127,6 @@ int main(int argc, char **argv) {
>
>
(argc,argv);
*/
return ret;
}

View file

@ -18,6 +18,7 @@ Multicolumn<TUPLE>::Multicolumn(int xid, Page *p, column_number_t column_count,
dispatcher_(column_count),
unpacked_(1)
{
stasis_page_cleanup(p_);
*column_count_ptr() = column_count;

View file

@ -20,6 +20,7 @@ template <class COMPRESSOR, class TYPE> 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<Pstar<COMPRESSOR,TYPE>,COMPRESSOR,TYPE>();
*freespace_ptr() = (intptr_t)recordsize_ptr() - (intptr_t)p_->memAddr;
*recordsize_ptr() = sizeof(TYPE);