Waldek Hebisch wrote:
Frank Heckenbach wrote:
+#ifndef EGCS97 newlevel->shared_decl_lang_specific = (struct lang_decl *) xmalloc (sizeof (*(newlevel->shared_decl_lang_specific))); #else newlevel->shared_decl_lang_specific = (struct lang_decl *) ggc_alloc (sizeof (*(newlevel->shared_decl_lang_specific)));
BTW, the same change could perhaps be made in line 315 above. But as I can't test it ATM, I better no do it. It's probably not very important there, and if 3.2 is dropped after integrating the preprocessor, it won't matter much in the long run anyway.
AFAICS the code is correct (for 3.2) now: we allocate binding level with xmalloc in pushlevel and we free it in poplevel. We could use `ggc_alloc', mark it and forget free. The patch below is doing that and apparently works, but I do not know if it worth switching to garbage collector here (if you would like to install the patch I can do more testing).
Frank Heckenbach wrote:
I don't care too much. If you think it needs more testing and don't want to waste your time, we can leave it.
I have run the test suite forcing garbage collection for each function, that should be enough testing for such change.
But now I'm wondering -- if we do change it, shouldn't we also remove this (for 3.2):
ggc_add_root (¤t_binding_level, 1, sizeof (current_binding_level), mark_binding_level);
In marketspeak "this is even more needed that was before". For 3.2 have to manually mark usefull stuff, and do slightly more work in `mark_binding_level'.