--- parser3/src/include/pa_pool.h 2003/03/18 09:53:01 1.86.4.2 +++ parser3/src/include/pa_pool.h 2003/07/24 11:31:21 1.87 @@ -9,7 +9,7 @@ #ifndef PA_POOL_H #define PA_POOL_H -static const char* IDENT_POOL_H="$Date: 2003/03/18 09:53:01 $"; +static const char* IDENT_POOL_H="$Date: 2003/07/24 11:31:21 $"; #include "pa_config_includes.h" @@ -37,12 +37,6 @@ class Pool { public: Pool(void *astorage); - ~Pool(); - - //{@ collector issues - void collect_garbage(); - void log_high_watermark(const char *msg); - //}@ //{@ statistics size_t total_allocated() { return ftotal_allocated; } @@ -53,11 +47,6 @@ public: void *get_context() { return fcontext; } /// allocates some bytes on pool - void *malloc_atomic(size_t size, int place=0) { - return check(real_malloc_atomic(size, place), size); - } - - /// allocates some bytes on pool void *malloc(size_t size, int place=0) { return check(real_malloc(size, place), size); } @@ -67,7 +56,7 @@ public: } /// registers a routine to clean up non-pooled allocations - void register_cleanup(void (*cleanup) (void *, void *), void *data) { + void register_cleanup(void (*cleanup) (void *), void *data) { if(!real_register_cleanup(cleanup, data)) fail_register_cleanup(); } @@ -123,12 +112,9 @@ private: //{ /// @name implementation defined - void real_init(); - void real_finit(); void *real_malloc(size_t size, int place); - void *real_malloc_atomic(size_t size, int place); void *real_calloc(size_t size); - bool real_register_cleanup(void (*cleanup) (void *,void *), void *data); + bool real_register_cleanup(void (*cleanup) (void *), void *data); //} private: @@ -171,12 +157,9 @@ private: //disabled @see NEW */ -/** - @todo: try to remember the meaning of this old comment: - all classes that are members parents of packed class [String] - sould be packed also to avoid sparc odd st/lduh problem - [packing is unacceptable for garbage collector] -*/ +// all classes that are members parents of packed class [String] +// sould be packed also to avoid sparc odd st/lduh problem +#include "pa_pragma_pack_begin.h" class Pooled { // the pool i'm allocated on Pool *fpool; @@ -201,9 +184,8 @@ public: //{ /// @name useful wrapper around pool void *malloc(size_t size, int place=0) const { return fpool->malloc(size, place); } - void *malloc_atomic(size_t size, int place=0) const { return fpool->malloc_atomic(size, place); } void *calloc(size_t size) const { return fpool->calloc(size); } - void register_cleanup(void (*cleanup) (void *, void *), void *data) { fpool->register_cleanup(cleanup, data); } + void register_cleanup(void (*cleanup) (void *), void *data) { fpool->register_cleanup(cleanup, data); } void *copy(const void *buf, const size_t size) { return fpool->copy(buf, size); } char *copy(const char *cstr) { return fpool->copy(cstr); } #ifdef XML @@ -224,7 +206,7 @@ public: #endif //} }; - +#include "pa_pragma_pack_end.h" /// useful macro for creating objects on current Pooled object Pooled::pool() #define NEW new(pool())