--- parser3/src/include/pa_hash.h 2017/02/15 17:05:21 1.97 +++ parser3/src/include/pa_hash.h 2020/10/11 22:58:37 1.100 @@ -17,7 +17,7 @@ #ifndef PA_HASH_H #define PA_HASH_H -#define IDENT_PA_HASH_H "$Id: pa_hash.h,v 1.97 2017/02/15 17:05:21 moko Exp $" +#define IDENT_PA_HASH_H "$Id: pa_hash.h,v 1.100 2020/10/11 22:58:37 moko Exp $" #include "pa_memory.h" #include "pa_types.h" @@ -125,7 +125,7 @@ public: HASH() { allocated=Hash_allocates[allocates_index=0]; fpairs_count=fused_refs=0; - refs=new Pair*[allocated]; + refs=new(PointerGC) Pair*[allocated]; HASH_ORDER_CLEAR(); } @@ -134,7 +134,7 @@ public: allocated=source.allocated; fused_refs=source.fused_refs; fpairs_count=source.fpairs_count; - refs=new Pair*[allocated]; + refs=new(PointerGC) Pair*[allocated]; // clone & rehash #ifdef HASH_ORDER HASH_ORDER_CLEAR(); @@ -163,7 +163,7 @@ public: delete pair; pair=next; } - delete[] refs; + operator delete[](refs); } #endif @@ -423,7 +423,7 @@ protected: if (allocates_indexcode==code && CORD_cmp(pair->key,(CORD)key)==0) return pair->value; - return V(0); + return V((const char *)0); } /// put a [value] under the [key] if that [key] existed @returns existed or not @@ -718,7 +718,11 @@ public: } String::Body key(){ +#ifdef HASH_CODE_CACHING return String::Body(fcurrent->key, fcurrent->code); +#else + return fcurrent->key; +#endif } V value(){