>>>>"APA" == Adrian Aichner
<adrian(a)xemacs.org> writes:
APA> face-cachel has now surpassed the amount
of memory used by cons
APA> cells.
This is due to your Dynarr_add workaround. The workaround is not
correct: You are losing the lrecord type information in Lisp dynamic
arrays. This has influence on the memory statistics. The allocation
count for objects allocated with Lisp dynamic arrays,
e.g. face-cachels, will never decrease because the type information
the statistics rely on is lost. This may also cause problems if the
allocator frees the objects and tries to recycle the memory.
The other crashes you reported with NEWGC=1 are probably also caused
by the incorrect workaround. Please try to see if you can figure out
another way to get VC++ 6.0 to like the code in Dynarr_add.
Maybe it works if you try to simplify the set_lheader_implementation
call with the help of local variables, for example:
#define Dynarr_add(d, el) \
do { \
const struct lrecord_implementation *imp = (d)->lisp_imp; \
int cur = (d)->cur; \
struct lrecord_header *elem = \
(struct lrecord_header *)&(((d)->base)[cur]); \
\
if (Dynarr_verify_mod (d)->cur >= (d)->max) \
Dynarr_resize ((d), (d)->cur+1); \
((d)->base)[(d)->cur] = (el); \
\
if (imp) \
set_lheader_implementation (elem, imp); \
\
(d)->cur++; \
if ((d)->cur > (d)->largest) \
(d)->largest = (d)->cur; \
} while (0)
Or something similar to that. What does VC++ 6.0 say to this one?
--
Marcus