Changeset 46f1d20 for src/examples/gc_no_raii
- Timestamp:
- Sep 9, 2016, 11:50:04 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ddcfb88
- Parents:
- 850fda6
- Location:
- src/examples/gc_no_raii
- Files:
-
- 1 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/gc_no_raii/bug-repro/field.c
r850fda6 r46f1d20 62 62 { 63 63 struct gc_object_header* object; 64 #if _DEBUG64 #ifndef NDEBUG 65 65 intptr_t lower_limit; 66 66 intptr_t upper_limit; … … 71 71 gc_pool_object_iterator* const this, 72 72 void* start_object 73 #if _DEBUG73 #ifndef NDEBUG 74 74 , intptr_t pool_start 75 75 , intptr_t pool_end -
src/examples/gc_no_raii/src/gcpointers.c
r850fda6 r46f1d20 14 14 gc_object_header* obj = gc_get_object_for_ref(gc_get_state(), (void*)this); 15 15 check(obj); 16 check( gc_obj_is_valide(obj));17 check(gc_is_managed(this) == gc_is_managed(obj->type_chain) || obj->type_chain == NULL);16 check(is_valid(obj)); 17 check(gc_is_managed(this) == gc_is_managed(obj->type_chain) || !obj->type_chain); 18 18 this->next = obj->type_chain; 19 19 obj->type_chain = this; 20 check( obj->is_valide());20 check(is_valid(obj)); 21 21 } 22 22 else … … 24 24 gc_object_header* obj = gc_get_object_ptr((void*)this->ptr); 25 25 check(obj); 26 check( gc_obj_is_valide(obj));27 check(gc_is_managed(this) == gc_is_managed(obj->root_chain) || obj->root_chain == NULL);26 check(is_valid(obj)); 27 check(gc_is_managed(this) == gc_is_managed(obj->root_chain) || !obj->root_chain); 28 28 this->next = obj->root_chain; 29 29 obj->root_chain = this; 30 check( gc_obj_is_valide(obj));30 check(is_valid(obj)); 31 31 } 32 32 } … … 124 124 // 125 125 // //Logical operators 126 forall(otype T) int ?!=?(gcpointer(T) this, int zero) { 127 return this.internal.ptr != 0; 128 } 126 129 // forall(otype T) int ?!=?(gcpointer(T) this, gcpointer(T) rhs); 127 130 // forall(otype T) int ?==?(gcpointer(T) this, gcpointer(T) rhs); -
src/examples/gc_no_raii/src/gcpointers.h
r850fda6 r46f1d20 3 3 #include <stdbool.h> 4 4 #include <stdint.h> 5 6 forall(dtype T) 7 struct gcpointer; 5 8 6 9 struct gcpointer_t … … 14 17 void ?{}(gcpointer_t* this, gcpointer_t other); 15 18 void ^?{}(gcpointer_t* this); 16 gcpointer_t * ?=?(gcpointer_tthis, gcpointer_t rhs);19 gcpointer_t ?=?(gcpointer_t* this, gcpointer_t rhs); 17 20 18 21 //Logical operators … … 21 24 bool gcpointer_null(gcpointer_t* this); 22 25 23 forall( otype T)26 forall(dtype T) 24 27 struct gcpointer 25 28 { … … 32 35 forall(otype T) void ?{}(gcpointer(T)* this, gcpointer(T)* other); 33 36 forall(otype T) void ^?{}(gcpointer(T)* this); 34 forall(otype T) gcpointer(T) ?=?(gcpointer(T) this, gcpointer(T) rhs);37 forall(otype T) gcpointer(T) ?=?(gcpointer(T)* this, gcpointer(T) rhs); 35 38 36 39 37 forall(otype T) T *?(gcpointer(T) this);40 // forall(otype T) T *?(gcpointer(T) this); 38 41 forall(otype T) T* get(gcpointer(T)* this); 39 42 40 43 //Logical operators 44 forall(otype T) int ?!=?(gcpointer(T) this, int zero); 41 45 forall(otype T) int ?!=?(gcpointer(T) this, gcpointer(T) rhs); 42 46 forall(otype T) int ?==?(gcpointer(T) this, gcpointer(T) rhs); -
src/examples/gc_no_raii/src/internal/card_table.h
r850fda6 r46f1d20 1 1 #pragma once 2 3 #include <stdlib>4 2 5 3 #include "globals.h" … … 19 17 }; 20 18 21 static inline void ctor (card_table_t* const this)19 static inline void ctor_card(card_table_t* const this) 22 20 { 23 21 this->count = 0; 24 22 } 25 23 26 static inline void dtor (card_table_t* const this)24 static inline void dtor_card(card_table_t* const this) 27 25 { 28 26 … … 48 46 else 49 47 { 50 check(card == count);48 check(card == this->count); 51 49 this->count++; 52 50 this->cards_start[card] = object; -
src/examples/gc_no_raii/src/internal/collector.c
r850fda6 r46f1d20 25 25 gc_object_header* obj = gc_get_object_ptr((void*)target->ptr); 26 26 27 check( gc_is_valide(obj));27 check(is_valid(obj)); 28 28 29 29 gcpointer_t** prev_next_ptr = managed ? &obj->type_chain : &obj->root_chain; … … 38 38 void* gc_allocate(size_t target_size) 39 39 { 40 sout | "Allocating " | target_size | " bytes" | endl;40 // sout | "Allocating " | target_size | " bytes" | endl; 41 41 42 42 size_t size = gc_compute_size(target_size + sizeof(gc_object_header)); 43 43 44 sout | "Object header size: " | sizeof(gc_object_header) | " bytes" | endl;45 sout | "Actual allocation size: " | size | " bytes" | endl;44 // sout | "Object header size: " | sizeof(gc_object_header) | " bytes" | endl; 45 // sout | "Actual allocation size: " | size | " bytes" | endl; 46 46 47 47 check(size < POOL_SIZE_BYTES); … … 60 60 if((intptr_t)(block = gc_try_allocate(gc, size))) return gc_finish_alloc_block(block, size, target_size); 61 61 62 checkf( false, "ERROR: allocation in new pool failed");62 checkf( (int) 0, "ERROR: allocation in new pool failed"); 63 63 64 64 return NULL; … … 67 67 void* gc_finish_alloc_block(void* block, size_t actual_size, size_t target_size) 68 68 { 69 void* data = (void*)(((intptr_t)block) + sizeof(gc_object_header));69 intptr_t data = ((intptr_t)block) + sizeof(gc_object_header); 70 70 void* header = block; 71 71 72 check( ((intptr_t)data)> ((intptr_t)block));73 check( ((intptr_t)data)>= ((intptr_t)header));74 check( is_aligned(data));75 check( ((intptr_t)data) + target_size <= ((intptr_t)block) + actual_size);72 check( data > ((intptr_t)block)); 73 check( data >= ((intptr_t)header)); 74 check( gc_is_aligned( (void*)data ) ); 75 check( data + target_size <= ((intptr_t)block) + actual_size ); 76 76 77 77 gc_object_header* obj = placement_ctor(header, actual_size); 78 78 79 79 (void)obj; //remove unsused warning since this is for debug 80 check(obj == g et_object_ptr(data));80 check(obj == gc_get_object_ptr( (void*)data )); 81 81 82 82 gc_register_allocation(gc_get_state(), actual_size); 83 83 84 return data;84 return (void*)data; 85 85 } 86 86 … … 119 119 check(!ptr->forward); 120 120 check(!ptr->is_forwarded); 121 check(gc_ is_from_space(gc_pool_of(ptr)));121 check(gc_pool_is_from_space(gc_pool_of(ptr))); 122 122 123 123 gc_memory_pool* pool = gc_pool_of(ptr)->mirror; … … 143 143 check(((intptr_t)field) < ((intptr_t)((intptr_t)object) + object->size)); 144 144 145 check(gc_is_in_to_space(gc_get_state(), & type->ptr));145 check(gc_is_in_to_space(gc_get_state(), &field->ptr)); 146 146 147 147 intptr_t* ref = &field->ptr; -
src/examples/gc_no_raii/src/internal/memory_pool.c
r850fda6 r46f1d20 1 1 #include "memory_pool.h" 2 2 3 #include <stdlib> 3 extern "C" { 4 #include <stdlib.h> 5 #include <string.h> 6 } 4 7 8 #include "collector.h" 5 9 #include "object_header.h" 6 10 … … 15 19 card_table_t* new = (card_table_t*)malloc(sizeof(card_table_t)); 16 20 this->cards = new; 17 ctor (this->cards);21 ctor_card(this->cards); 18 22 19 23 this->end_p = ((uint8_t*)this) + size; 20 24 this->free_p = this->start_p; 21 25 22 check( gc_pool_of(this) == this);26 check( gc_pool_of( (void*)this ) == this); 23 27 check(this->cards); 24 28 gc_reset_pool(this); … … 27 31 void dtor(gc_memory_pool *const this) 28 32 { 29 dtor (this->cards);33 dtor_card(this->cards); 30 34 free(this->cards); 31 35 } … … 34 38 { 35 39 this->free_p = this->start_p; 36 #if _DEBUG37 memset(this->start_p, 0xCD, gc_pool_ total_size(this));40 #ifndef NDEBUG 41 memset(this->start_p, 0xCD, gc_pool_size_total(this)); 38 42 #endif 39 43 … … 41 45 reset(this->cards); 42 46 43 check(gc_pool_size_left(this) == gc_pool_ total_size(this));47 check(gc_pool_size_left(this) == gc_pool_size_total(this)); 44 48 } 45 49 … … 58 62 } 59 63 60 void ctor( 61 gc_pool_object_iterator* const this, 64 void ?{}( gc_pool_object_iterator* this, 62 65 struct gc_object_header* start_object 63 #if _DEBUG66 #ifndef NDEBUG 64 67 , intptr_t pool_start 65 68 , intptr_t pool_end … … 68 71 { 69 72 this->object = start_object; 70 #if _DEBUG73 #ifndef NDEBUG 71 74 this->lower_limit = pool_start; 72 75 this->upper_limit = pool_end; 73 76 #endif 74 77 75 check( ((intptr_t)start_object) >= lower_limit );76 check( ((intptr_t)start_object) <= upper_limit );78 check( ((intptr_t)start_object) >= this->lower_limit ); 79 check( ((intptr_t)start_object) <= this->upper_limit ); 77 80 } 81 82 void ^?{}( gc_pool_object_iterator* this ) {} 78 83 79 84 gc_pool_object_iterator gc_pool_iterator_for(gc_memory_pool* const this, void* member) … … 81 86 size_t card = card_of(member); 82 87 intptr_t member_add = (intptr_t)member; 83 void*start_obj;88 intptr_t start_obj; 84 89 intptr_t start_obj_add; 85 90 … … 87 92 { 88 93 check(card < CARDS_COUNT); 89 start_obj = object_at(this->cards, card);94 start_obj = (intptr_t)object_at(this->cards, card); 90 95 check(card != 0 || start_obj); 91 96 card--; … … 94 99 while(start_obj_add > member_add || start_obj_add != 0); 95 100 96 check( start_obj);97 101 check( start_obj ); 102 98 103 struct gc_object_header* start_obj_typed = (struct gc_object_header*)start_obj; 99 104 100 gc_pool_object_iterator it; 101 ctor( &it, 102 start_obj_typed, 103 #if _DEBUG 105 return (gc_pool_object_iterator) { 106 start_obj_typed 107 #ifndef NDEBUG 104 108 , (intptr_t)this->start_p 105 109 , (intptr_t)this->free_p 106 110 #endif 107 ); 108 return it; 111 }; 109 112 } 110 113 … … 117 120 { 118 121 struct gc_object_header* start_obj = (struct gc_object_header*)this->start_p; 119 gc_pool_object_iterator it; 120 ctor( &it, 121 start_obj, 122 #if _DEBUG 122 return (gc_pool_object_iterator) { 123 start_obj 124 #ifndef NDEBUG 123 125 , (intptr_t)this->start_p 124 126 , (intptr_t)this->free_p 125 127 #endif 126 ); 127 return it; 128 }; 128 129 } 129 130 130 131 gc_pool_object_iterator end(gc_memory_pool* const this) 131 132 { 132 gc_pool_object_iterator it; 133 ctor( &it, 134 (struct gc_object_header*)this->free_p, 135 #if _DEBUG 133 return (gc_pool_object_iterator) { 134 (struct gc_object_header*)this->free_p 135 #ifndef NDEBUG 136 136 , (intptr_t)this->start_p 137 137 , (intptr_t)this->free_p 138 138 #endif 139 ); 140 return it; 139 }; 141 140 } 142 141 … … 145 144 struct gc_object_header* object = it->object; 146 145 intptr_t next_ptr = ((intptr_t)object) + object->size; 147 check(next_ptr > lower_limit);148 check(next_ptr <= upper_limit);146 check(next_ptr > it->lower_limit); 147 check(next_ptr <= it->upper_limit); 149 148 150 149 struct gc_object_header* next_obj = ((struct gc_object_header*)next_ptr); 151 check(next_ptr == upper_limit || is_valide(next_obj));150 check(next_ptr == it->upper_limit || is_valid(next_obj)); 152 151 153 152 it->object = next_obj; -
src/examples/gc_no_raii/src/internal/memory_pool.h
r850fda6 r46f1d20 39 39 { 40 40 struct gc_object_header* object; 41 #if _DEBUG41 #ifndef NDEBUG 42 42 intptr_t lower_limit; 43 43 intptr_t upper_limit; … … 46 46 47 47 48 void ctor( 49 gc_pool_object_iterator* const this, 48 void ?{}( gc_pool_object_iterator* this, 50 49 struct gc_object_header* start_object 51 #if _DEBUG50 #ifndef NDEBUG 52 51 , intptr_t pool_start 53 52 , intptr_t pool_end 54 53 #endif 55 54 ); 55 56 void ^?{}( gc_pool_object_iterator* this ); 56 57 57 58 bool ?!=?(const gc_pool_object_iterator lhs, const gc_pool_object_iterator rhs); -
src/examples/gc_no_raii/src/internal/object_header.c
r850fda6 r46f1d20 3 3 #include <stdint.h> 4 4 5 #include "collector.h" 5 6 #include "globals.h" 6 7 #include "gcpointers.h" … … 8 9 void ctor(gc_object_header* const this, size_t inSize) 9 10 { 10 #if _DEBUG11 #ifndef NDEBUG 11 12 this->canary_start = CANARY_VALUE; 12 13 #endif … … 18 19 this->is_forwarded = false; 19 20 20 #if _DEBUG21 #ifndef NDEBUG 21 22 this->canary_end = CANARY_VALUE; 22 23 #endif … … 25 26 void copy_ctor(gc_object_header* const this, const gc_object_header* const other) 26 27 { 27 #if _DEBUG28 #ifndef NDEBUG 28 29 this->canary_start = CANARY_VALUE; 29 30 #endif … … 35 36 this->is_forwarded = false; 36 37 37 #if _DEBUG38 #ifndef NDEBUG 38 39 this->canary_end = CANARY_VALUE; 39 40 #endif … … 42 43 while(root) 43 44 { 44 check(g et_object_ptr(root->ptr) == other);45 check(gc_get_object_ptr( (void*)root->ptr ) == other); 45 46 root->ptr = ((intptr_t)this) + sizeof(gc_object_header); 46 47 47 check(g et_object_ptr(root->ptr) == this);48 check(gc_get_object_ptr( (void*)root->ptr ) == this); 48 49 root = root->next; 49 50 } … … 56 57 57 58 size_t offset = (intptr_t)type - (intptr_t)other; 58 check(offset < size);59 check(offset < this->size); 59 60 60 61 gcpointer_t* member_ptr = (gcpointer_t*)( (intptr_t)this + offset ); … … 63 64 64 65 size_t next_offset = type->next ? (intptr_t)type->next - (intptr_t)other : 0; 65 check(next_offset < size);66 check(next_offset < this->size); 66 67 67 68 gcpointer_t* next_ptr = type->next ? (gcpointer_t*)((intptr_t)this + next_offset) : NULL; … … 73 74 } 74 75 75 check(is_valid e(this));76 check(is_valid(this)); 76 77 } 77 78 78 #if _DEBUG79 bool is_valid e(const gc_object_header* const this)79 #ifndef NDEBUG 80 bool is_valid(const gc_object_header* const this) 80 81 { 81 check( this->canary_start ==CANARY_VALUE);82 check( this->canary_end ==CANARY_VALUE);82 check((intptr_t)this->canary_start == (intptr_t)CANARY_VALUE); 83 check((intptr_t)this->canary_end == (intptr_t)CANARY_VALUE); 83 84 84 check(this->is_forwarded == ( this->forward != nullptr));85 check(this->is_forwarded == ( (intptr_t)this->forward != (intptr_t)NULL)); 85 86 86 87 check(this->size < POOL_SIZE_BYTES); … … 89 90 while(root) 90 91 { 91 check(g et_object_ptr(root->ptr) == this);92 check(gc_get_object_ptr( (void*)root->ptr ) == this); 92 93 93 94 root = root->next; 94 95 } 95 96 96 gcpointer_t* type = t ype_chain;97 gcpointer_t* type = this->type_chain; 97 98 while(type) 98 99 { 99 100 check((intptr_t)type > (intptr_t)this); 100 check((intptr_t)type < (intptr_t)(( intptr_t)this +size));101 check((intptr_t)type < (intptr_t)(((intptr_t)this) + this->size)); 101 102 102 103 type = type->next; -
src/examples/gc_no_raii/src/internal/object_header.h
r850fda6 r46f1d20 7 7 #include "tools.h" 8 8 9 #if 10 static const long unsigned int CANARY_VALUE =0xCAFEBABACAFEBABA;9 #ifndef NDEBUG 10 static void* const CANARY_VALUE = (void*)0xCAFEBABACAFEBABA; 11 11 #endif 12 12 … … 16 16 struct gc_object_header 17 17 { 18 #if 18 #ifndef NDEBUG 19 19 void* canary_start; 20 20 #endif … … 26 26 bool is_forwarded; 27 27 28 #if 28 #ifndef NDEBUG 29 29 void* canary_end; 30 30 #endif … … 47 47 return this; 48 48 } 49 50 #ifndef NDEBUG 51 bool is_valid( struct gc_object_header* obj ); 52 #endif -
src/examples/gc_no_raii/src/internal/state.c
r850fda6 r46f1d20 21 21 void gc_state_calc_usage(gc_state *const this); 22 22 23 #if 23 #ifndef NDEBUG 24 24 bool gc_state_roots_match(gc_state *const this); 25 25 bool gc_state_no_from_space_ref(gc_state *const this); … … 97 97 } 98 98 99 checkf( false, "is_in_heap() and iterator_for() return inconsistent data");99 checkf( (int) 0, "is_in_heap() and iterator_for() return inconsistent data"); 100 100 abort(); 101 101 return NULL; … … 176 176 this->from_code = (~this->from_code) & 0x01; 177 177 178 #if _DEBUG178 #ifndef NDEBUG 179 179 { 180 180 gc_memory_pool* pool = this->from_space; … … 251 251 } 252 252 253 #if _DEBUG253 #ifndef NDEBUG 254 254 bool gc_state_roots_match(gc_state* const this) 255 255 { … … 265 265 size += object->size; 266 266 267 gcpointer_ base* ptr = object->root_chain;267 gcpointer_t* ptr = object->root_chain; 268 268 while(ptr) 269 269 { 270 check(g et_object_ptr(ptr->m_ptr) == object);271 ptr = ptr-> m_next;270 check(gc_get_object_ptr( (void*)ptr->ptr ) == object); 271 ptr = ptr->next; 272 272 } 273 273 } … … 286 286 while(pool) 287 287 { 288 void** potential_ref = (void**)pool-> m_start;289 while(potential_ref < (void**)pool-> m_free)288 void** potential_ref = (void**)pool->start_p; 289 while(potential_ref < (void**)pool->free_p) 290 290 { 291 291 check(!gc_is_in_heap(this, *potential_ref)); -
src/examples/gc_no_raii/src/internal/state.h
r850fda6 r46f1d20 38 38 static inline bool gc_needs_collect(gc_state* state) 39 39 { 40 sout | "Used Space: " | state->used_space | " bytes" | endl;40 // sout | "Used Space: " | state->used_space | " bytes" | endl; 41 41 return state->used_space * 2 > state->total_space; 42 42 } -
src/examples/gc_no_raii/src/tools/checks.h
r850fda6 r46f1d20 1 1 #pragma once 2 2 3 #if _DEBUG 3 #ifdef NDEBUG 4 5 #define check(x) 6 7 #define checkf(x, format, ...) 8 9 #warning no debug checks 10 11 #else 4 12 5 13 #include <stdlib.h> … … 10 18 printf("CHECK failed : %s at %s:%i\n", #x, __FILE__, __LINE__);\ 11 19 abort();\ 12 }}while( 0)\20 }}while( (int)0 )\ 13 21 14 22 #define checkf(x, ...) do {\ … … 17 25 printf(__VA_ARGS__);\ 18 26 abort();\ 19 }}while(0)\ 20 21 #else 22 23 #define check(x) 24 25 #define checkf(x, format, ...) 27 }}while( (int)0 )\ 26 28 27 29 #endif //NO_CHECKS -
src/examples/gc_no_raii/src/tools/print.c
r850fda6 r46f1d20 1 1 #include "tools.h" 2 2 3 #if _DEBUG4 ofstream *sout = ofstream_stdout();3 #ifndef NDEBUG 4 // ofstream *sout = ofstream_stdout(); 5 5 #endif -
src/examples/gc_no_raii/src/tools/print.h
r850fda6 r46f1d20 1 1 #pragma once 2 2 3 #if _DEBUG4 5 #include <fstream>6 7 #define DEBUG_OUT(x) sout | x | endl;8 9 #else3 // #ifndef NDEBUG 4 // 5 // #include <fstream> 6 // 7 // #define DEBUG_OUT(x) sout | x | endl; 8 // 9 // #else 10 10 11 11 #define DEBUG_OUT(x) 12 12 13 #endif //NO_CHECKS13 // #endif //NO_CHECKS -
src/examples/gc_no_raii/test/badlll.c
r850fda6 r46f1d20 1 1 #include "gc.h" 2 3 #include <stdio.h> 2 4 3 5 struct List_t … … 7 9 }; 8 10 9 void ?{}(List_t* this);10 List_t* ?=?(List_t* this, List_t* rhs);11 12 11 typedef gcpointer(List_t) LLL; 13 12 14 13 #define MAX (1024 * 1024) 15 14 16 // LLL buildLLL(int sz) 17 void bla() 15 LLL buildLLL(int sz) 18 16 { 19 int i; 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; 17 int i = 0; 18 LLL ll0, lll, llc; 19 20 gcmalloc( &ll0 ); 21 List_t* ll0_ptr = get( &ll0 ); 22 ll0_ptr->val = i; 23 lll = ll0; 24 25 for (i = 1; i < sz; i++) 26 { 27 gcmalloc( &llc ); 28 List_t* llc_ptr = get( &llc ); 29 llc_ptr->val = i; 30 List_t* lll_ptr = get( &lll ); 31 lll_ptr->next = llc; 32 33 lll = llc; 34 } 35 36 return ll0; 35 37 } 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 // } 38 39 void testLLL(LLL lll) 40 { 41 unsigned char *counted; 42 43 counted = (unsigned char *) calloc(MAX, sizeof(unsigned char)); 44 while (lll) 45 { 46 List_t* lll_ptr = get( &lll ); 47 counted[lll_ptr->val]++; 48 if (counted[lll_ptr->val] > 1) 49 { 50 fprintf(stderr, "ERROR! Encountered %d twice!\n", lll_ptr->val); 51 exit(1); 52 } 53 lll = lll_ptr->next; 54 } 55 56 return; 57 } 55 58 56 59 int main(void) … … 58 61 LLL mylll; 59 62 60 //mylll = buildLLL(MAX);61 // 62 //testLLL(mylll);63 mylll = buildLLL(MAX); 64 65 testLLL(mylll); 63 66 64 67 return 0;
Note: See TracChangeset
for help on using the changeset viewer.