#include #include struct link { struct link *previous; size_t value; }; int main(void) { GC_INIT(); struct link *root = NULL; for (size_t i = 0; i < 8192; ++i) { struct link *next = GC_MALLOC(sizeof(*next)); if (next == NULL) return 1; next->previous = root; next->value = i; root = next; } GC_gcollect(); for (size_t count = 8192; count != 0; --count) { if (root == NULL || root->value != count - 1) return 2; root = root->previous; } return root != NULL; }