diff --git a/StringHeap.cc b/StringHeap.cc index 1a704d99e..f53c21674 100644 --- a/StringHeap.cc +++ b/StringHeap.cc @@ -23,7 +23,7 @@ * Picture Elements, Inc., 777 Panoramic Way, Berkeley, CA 94704. */ #ifdef HAVE_CVS_IDENT -#ident "$Id: StringHeap.cc,v 1.2 2002/08/12 01:34:58 steve Exp $" +#ident "$Id: StringHeap.cc,v 1.3 2003/01/16 21:44:46 steve Exp $" #endif # include "StringHeap.h" @@ -38,6 +38,7 @@ StringHeap::StringHeap() { cell_base_ = 0; cell_ptr_ = HEAPCELL; + cell_count_ = 0; } StringHeap::~StringHeap() @@ -55,6 +56,8 @@ const char* StringHeap::add(const char*text) if (rem < (len+1)) { cell_base_ = (char*)malloc(HEAPCELL); cell_ptr_ = 0; + cell_count_ += 1; + assert(cell_base_ != 0); } char*res = cell_base_ + cell_ptr_; @@ -62,11 +65,16 @@ const char* StringHeap::add(const char*text) cell_ptr_ += len; cell_base_[cell_ptr_++] = 0; + assert(cell_ptr_ <= HEAPCELL); + return res; } /* * $Log: StringHeap.cc,v $ + * Revision 1.3 2003/01/16 21:44:46 steve + * Keep some debugging status. + * * Revision 1.2 2002/08/12 01:34:58 steve * conditional ident string using autoconfig. * diff --git a/StringHeap.h b/StringHeap.h index 2a7d278b5..5f9b0dcd8 100644 --- a/StringHeap.h +++ b/StringHeap.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: StringHeap.h,v 1.2 2002/08/12 01:34:58 steve Exp $" +#ident "$Id: StringHeap.h,v 1.3 2003/01/16 21:44:46 steve Exp $" #endif class StringHeap { @@ -35,6 +35,7 @@ class StringHeap { char*cell_base_; unsigned cell_ptr_; + unsigned cell_count_; private: // not implemented StringHeap(const StringHeap&); @@ -43,6 +44,9 @@ class StringHeap { /* * $Log: StringHeap.h,v $ + * Revision 1.3 2003/01/16 21:44:46 steve + * Keep some debugging status. + * * Revision 1.2 2002/08/12 01:34:58 steve * conditional ident string using autoconfig. *