--- parser3/src/include/pa_pool.h 2001/10/19 12:43:30 1.64 +++ parser3/src/include/pa_pool.h 2001/10/29 13:04:46 1.68 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_pool.h,v 1.64 2001/10/19 12:43:30 parser Exp $ + $Id: pa_pool.h,v 1.68 2001/10/29 13:04:46 paf Exp $ */ #ifndef PA_POOL_H @@ -14,6 +14,7 @@ #include "pa_config_includes.h" #ifdef XML +#include #include #include #endif @@ -21,7 +22,6 @@ // forwards class Exception; -class Temp_exception; class String; /** @@ -44,8 +44,8 @@ public: void *tag() { return ftag; } /// allocates some bytes on pool - void *malloc(size_t size/*, int place=0*/) { - return check(real_malloc(size/*, place*/), size); + void *malloc(size_t size, int place=0) { + return check(real_malloc(size, place), size); } /// allocates some bytes clearing them with zeros void *calloc(size_t size) { @@ -74,7 +74,7 @@ private: //{ /// @name implementation defined - void *real_malloc(size_t size/*, int place*/); + void *real_malloc(size_t size, int place); void *real_calloc(size_t size); bool real_register_cleanup(void (*cleanup) (void *), void *data); //} @@ -105,9 +105,9 @@ public: /// converts Xalan string to parser String String& transcode(const XalanDOMString& s); /// converts char * to Xalan string - XalanDOMString& Pool::transcode_buf(const char *buf, size_t buf_size); + std::auto_ptr transcode_buf(const char *buf, size_t buf_size); /// converts parser String to Xalan string - XalanDOMString& Pool::transcode(const String& s); + std::auto_ptr transcode(const String& s); private: @@ -140,7 +140,7 @@ public: /// the Pooled-sole: Pooled instances can be allocated in Pool rather then on heap static void *operator new(size_t size, Pool& apool) { - return apool.malloc(size/*, 1*/); + return apool.malloc(size, 1); } Pooled(Pool& apool) : fpool(&apool) {} @@ -156,7 +156,7 @@ public: //{ /// @name useful wrapper around pool - void *malloc(size_t size) const { return fpool->malloc(size); } + void *malloc(size_t size, int place=0) const { return fpool->malloc(size, place); } void *calloc(size_t size) const { return fpool->calloc(size); } void register_cleanup(void (*cleanup) (void *), void *data) { fpool->register_cleanup(cleanup, data); } #ifdef XML