Ignore:
Timestamp:
Aug 4, 2016, 9:18:10 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:
00c32e9, 76e8c55
Parents:
aea7168
Message:

GC files now compile, still working on a compiling example

Location:
src/examples/gc_no_raii/test
Files:
2 edited

Legend:

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

    raea7168 rbee4283  
    77};
    88
     9void ?{}(List_t* this);
     10List_t* ?=?(List_t* this, List_t* rhs);
     11
    912typedef gcpointer(List_t) LLL;
    1013
    1114#define MAX (1024 * 1024)
    1215
    13 LLL buildLLL(int sz)
     16// LLL buildLLL(int sz)
     17void bla()
    1418{
    1519        int i;
    16         LLL ll0, lll, llc;
    17 
    18         ll0 = gcmalloc();
    19         ll0->val = 0;
    20         lll = ll0;
    21 
    22         for (i = 1; i < sz; i++)
    23         {
    24                 llc = gcmalloc();
    25                 llc->val = i;
    26                 lll->next = llc;
    27                 lll = llc;
    28         }
    29 
    30         return ll0;
     20        // LLL ll0;//, lll, llc;
     21//
     22//      ll0 = gcmalloc();
     23//      ll0->val = 0;
     24//      lll = ll0;
     25//
     26//      for (i = 1; i < sz; i++)
     27//      {
     28//              llc = gcmalloc();
     29//              llc->val = i;
     30//              lll->next = llc;
     31//              lll = llc;
     32//      }
     33//
     34        // return ll0;
    3135}
    32 
    33 void testLLL(LLL lll)
    34 {
    35         unsigned char *counted;
    36 
    37         counted = (unsigned char *) calloc(MAX, sizeof(unsigned char));
    38         while (lll)
    39         {
    40                 counted[lll->val]++;
    41                 if (counted[lll->val] > 1)
    42                 {
    43                         fprintf(stderr, "ERROR! Encountered %d twice!\n", lll->val);
    44                         exit(1);
    45                 }
    46                 lll = lll->next;
    47         }
    48 
    49         return;
    50 }
     36//
     37// void testLLL(LLL lll)
     38// {
     39//      unsigned char *counted;
     40//
     41//      counted = (unsigned char *) calloc(MAX, sizeof(unsigned char));
     42//      while (lll)
     43//      {
     44//              counted[lll->val]++;
     45//              if (counted[lll->val] > 1)
     46//              {
     47//                      fprintf(stderr, "ERROR! Encountered %d twice!\n", lll->val);
     48//                      exit(1);
     49//              }
     50//              lll = lll->next;
     51//      }
     52//
     53//      return;
     54// }
    5155
    5256int main(void)
     
    5458        LLL mylll;
    5559
    56         mylll = buildLLL(MAX);
    57 
    58         testLLL(mylll);
     60        // mylll = buildLLL(MAX);
     61        //
     62        // testLLL(mylll);
    5963
    6064        return 0;
  • src/examples/gc_no_raii/test/gctest.c

    raea7168 rbee4283  
    77int main() {
    88        sout | "Bonjour au monde!\n";
     9
     10        gcpointer(int) anInt = gcmalloc();
    911}
Note: See TracChangeset for help on using the changeset viewer.