Ignore:
Timestamp:
Aug 18, 2016, 10:08:31 AM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
7a5d773
Parents:
926af74
Message:

first basic test for garbage collector now compiles and works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/examples/gc_no_raii/test/gctest.c

    r926af74 r6643e72  
    22
    33#include "gc.h"
     4#include "internal/collector.h"
    45
    56#warning default test
     
    89        sout | "Bonjour au monde!\n";
    910
    10         for(int i = 0; i < 1000000; i++) {
    11                 gcpointer(int) anInt;
    12                 gcmalloc(&anInt);
     11        gcpointer(int) theInt;
     12        gcmalloc(&theInt);
     13
     14        for(int i = 0; i < 10; i++) {
     15                int a;
     16                {
     17                        gcpointer(int) anInt;
     18                        gcmalloc(&anInt);
     19                }
     20                int p;
    1321        }
     22
     23        gc_collect(gc_get_state());
     24        gc_conditional_collect();
    1425}
Note: See TracChangeset for help on using the changeset viewer.