Dear Christoph Egger
<https://bugs.debian.org/cgi-bin/pkgreport.cgi?maint=christoph%40debian.org>
,
I've tried to test performance of libgc with simple code.
I've made a simple program that creates a single linked list, but
remembers only last item.
It leaks memory when linked with bundled libgc, and do not leaks when
linked with libgc compilled from source.
Note: while i'm using Ubuntu, i've already asked my friend to test it
on Debian stable, and he confirms bug exists. That is why I post bug
report to Debian.
Source code:
#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;
}
}