[Gc] Strange leak in simple code

Юрий Соколов <[email protected]> Mon, 13 Jul 2015 14:12:40 +0300
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <CAL-rCA2QBUkgP4e68_xOuZt4ZR=6s1=EmKN97VBGug=pwgBqbA@mail.gmail.com>
Using libgc from Ubuntu 15.04 (7.2b-6.4) this simple code leaks:

    #include <gc.h>
    struct list {
        struct list* next;    };
        int main() {
        GC_INIT();
        struct list *last = NULL;
        for (;;) {
            struct list* nuo = GC_MALLOC(sizeof(struct list));
            nuo->next = NULL;
            // if next line is commented, then no leakage
            if (last) last->next = nuo;
            last = nuo;
        }    }



stackoverflow question
http://stackoverflow.com/questions/31380641/libgc-why-this-code-leaks

_______________________________________________
bdwgc mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/bdwgc