ADT
        aaron-thesis
        arm-eh
        ast-experimental
        cleanup-dtors
        deferred_resn
        demangler
        enum
        forall-pointer-decay
        jacob/cs343-translation
        jenkins-sandbox
        new-ast
        new-ast-unique-expr
        new-env
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
        resolv-new
        with_gc
      
      
        
          | Last change
 on this file since 6a36975 was             6643e72, checked in by Thierry Delisle <tdelisle@…>, 9 years ago | 
        
          | 
first basic test for garbage collector now compiles and works
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            347 bytes | 
      
      
| Line |  | 
|---|
| 1 | #include <fstream> | 
|---|
| 2 |  | 
|---|
| 3 | #include "gc.h" | 
|---|
| 4 | #include "internal/collector.h" | 
|---|
| 5 |  | 
|---|
| 6 | #warning default test | 
|---|
| 7 |  | 
|---|
| 8 | int main() { | 
|---|
| 9 | sout | "Bonjour au monde!\n"; | 
|---|
| 10 |  | 
|---|
| 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; | 
|---|
| 21 | } | 
|---|
| 22 |  | 
|---|
| 23 | gc_collect(gc_get_state()); | 
|---|
| 24 | gc_conditional_collect(); | 
|---|
| 25 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.