--- parser3/src/include/pa_array.h 2024/11/17 14:04:28 1.101 +++ parser3/src/include/pa_array.h 2025/08/01 16:14:44 1.105 @@ -8,7 +8,7 @@ #ifndef PA_ARRAY_H #define PA_ARRAY_H -#define IDENT_PA_ARRAY_H "$Id: pa_array.h,v 1.101 2024/11/17 14:04:28 moko Exp $" +#define IDENT_PA_ARRAY_H "$Id: pa_array.h,v 1.105 2025/08/01 16:14:44 moko Exp $" // includes @@ -169,7 +169,7 @@ public: inline void clear() { if(fsize) - memset(felements, 0, fsize * sizeof(T)); + memset((void *)felements, 0, fsize * sizeof(T)); fsize=0; } @@ -227,6 +227,11 @@ protected: void resize(size_t asize) { if(fallocated){ felements=(T *)pa_realloc(felements, asize*sizeof(T)); +#ifdef PA_DEBUG_DISABLE_GC + // non-gc realloc doesn't zero; manually zero expanded region + if(asize > fallocated) + memset((void *)(felements+fallocated), 0, (asize-fallocated) * sizeof(T)); +#endif fallocated=asize; } else { fallocated=asize; @@ -318,11 +323,6 @@ public: inline size_t index() { return fcurrent - farray.felements; } - - // returns the current index string value of the iterator - inline char *key() { - return pa_uitoa(index()); - } }; // Slower array iterator for arrays that can be modified during iteration @@ -349,10 +349,6 @@ public: inline size_t index() { return findex; } - - inline char* key() { - return pa_uitoa(findex); - } }; // Robust as used for arrays that can be modified during iteration @@ -375,9 +371,5 @@ public: inline size_t index() { return findex; } - - inline char *key() { - return pa_uitoa(index()); - } }; #endif