Changeset dafbde8 for tests/zombies/gc_no_raii
- Timestamp:
- Jan 20, 2021, 4:49:40 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 454f478
- Parents:
- 92bfda0 (diff), fd54fef (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- tests/zombies/gc_no_raii
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/zombies/gc_no_raii/bug-repro/blockers/explicit_cast.c
r92bfda0 rdafbde8 9 9 }; 10 10 11 forall( otypeT)11 forall(T) 12 12 struct gcpointer 13 13 { … … 15 15 }; 16 16 17 forall( otypeT)17 forall(T) 18 18 static inline gcpointer(T) gcmalloc() 19 19 { -
tests/zombies/gc_no_raii/bug-repro/blockers/recursive_realloc.c
r92bfda0 rdafbde8 3 3 #include <stdlib.hfa> 4 4 5 trait allocator_c( otype T, otypeallocator_t)5 trait allocator_c(T, allocator_t) 6 6 { 7 7 void realloc(allocator_t* const, size_t); 8 8 }; 9 9 10 forall( otypeT)10 forall(T) 11 11 struct heap_allocator 12 12 { … … 15 15 }; 16 16 17 forall( otypeT)17 forall(T) 18 18 inline void realloc(heap_allocator(T) *const this, size_t size) 19 19 { -
tests/zombies/gc_no_raii/bug-repro/deref.c
r92bfda0 rdafbde8 1 forall( otypeT)1 forall(T) 2 2 struct wrap 3 3 { … … 5 5 }; 6 6 7 forall( otypeT)7 forall(T) 8 8 T *? (wrap(T) rhs) 9 9 { -
tests/zombies/gc_no_raii/bug-repro/field.c
r92bfda0 rdafbde8 8 8 //------------------------------------------------------------------------------ 9 9 //Declaration 10 trait allocator_c( otype T, otypeallocator_t)10 trait allocator_c(T, allocator_t) 11 11 { 12 12 void ctor(allocator_t* const); … … 16 16 }; 17 17 18 forall( otype T, otypeallocator_t | allocator_c(T, allocator_t))18 forall(T, allocator_t | allocator_c(T, allocator_t)) 19 19 struct vector 20 20 { -
tests/zombies/gc_no_raii/bug-repro/malloc.c
r92bfda0 rdafbde8 1 forall( otypeT)1 forall(T) 2 2 struct wrapper 3 3 { … … 5 5 }; 6 6 7 forall( otypeT)7 forall(T) 8 8 void ctor(wrapper(T)* this) 9 9 { … … 11 11 } 12 12 13 forall( otypeT)13 forall(T) 14 14 wrapper(T) gcmalloc() 15 15 { … … 19 19 } 20 20 21 forall( otypeT)21 forall(T) 22 22 wrapper(T)* ?=? (wrapper(T)* lhs, wrapper(T)* rhs) 23 23 { -
tests/zombies/gc_no_raii/bug-repro/oddtype.c
r92bfda0 rdafbde8 1 forall( dtype T)1 forall(T &) 2 2 struct wrap { 3 3 int i; 4 4 }; 5 5 6 forall( otypeT) void ?{}(wrap(T)* this) {}7 forall( otypeT) void ?=?(wrap(T)* this) {}8 forall( otypeT) void ^?{}(wrap(T)* this) {}6 forall(T) void ?{}(wrap(T)* this) {} 7 forall(T) void ?=?(wrap(T)* this) {} 8 forall(T) void ^?{}(wrap(T)* this) {} 9 9 10 10 struct List_t { -
tests/zombies/gc_no_raii/bug-repro/push_back.h
r92bfda0 rdafbde8 1 1 //------------------------------------------------------------------------------ 2 2 //Declaration 3 trait allocator_c( otype T, otypeallocator_t) {3 trait allocator_c(T, allocator_t) { 4 4 void ctor(allocator_t* const); 5 5 void dtor(allocator_t* const); … … 8 8 }; 9 9 10 forall( otype T, otypeallocator_t | allocator_c(T, allocator_t))10 forall(T, allocator_t | allocator_c(T, allocator_t)) 11 11 struct vector 12 12 { … … 17 17 //------------------------------------------------------------------------------ 18 18 //Initialization 19 forall( otype T, otypeallocator_t | allocator_c(T, allocator_t))19 forall(T, allocator_t | allocator_c(T, allocator_t)) 20 20 void vector_ctor(vector(T, allocator_t) *const this); 21 21 22 forall( otype T, otypeallocator_t | allocator_c(T, allocator_t))22 forall(T, allocator_t | allocator_c(T, allocator_t)) 23 23 void dtor(vector(T, allocator_t) *const this); 24 24 25 25 //------------------------------------------------------------------------------ 26 26 //Allocator 27 forall( otypeT)27 forall(T) 28 28 struct heap_allocator 29 29 { … … 32 32 }; 33 33 34 forall( otypeT)34 forall(T) 35 35 void ctor(heap_allocator(T) *const this); 36 36 37 forall( otypeT)37 forall(T) 38 38 void dtor(heap_allocator(T) *const this); 39 39 40 forall( otypeT)40 forall(T) 41 41 void realloc(heap_allocator(T) *const this, size_t size); 42 42 43 forall( otypeT)43 forall(T) 44 44 inline T* data(heap_allocator(T) *const this) 45 45 { … … 49 49 //------------------------------------------------------------------------------ 50 50 //Capacity 51 forall( otype T, otypeallocator_t | allocator_c(T, allocator_t))51 forall(T, allocator_t | allocator_c(T, allocator_t)) 52 52 inline bool empty(vector(T, allocator_t) *const this) 53 53 { … … 55 55 } 56 56 57 forall( otype T, otypeallocator_t | allocator_c(T, allocator_t))57 forall(T, allocator_t | allocator_c(T, allocator_t)) 58 58 inline bool size(vector(T, allocator_t) *const this) 59 59 { … … 61 61 } 62 62 63 forall( otype T, otypeallocator_t | allocator_c(T, allocator_t))63 forall(T, allocator_t | allocator_c(T, allocator_t)) 64 64 inline void reserve(vector(T, allocator_t) *const this, size_t size) 65 65 { … … 69 69 //------------------------------------------------------------------------------ 70 70 //Modifiers 71 forall( otype T, otypeallocator_t | allocator_c(T, allocator_t))71 forall(T, allocator_t | allocator_c(T, allocator_t)) 72 72 void push_back(vector(T, allocator_t) *const this, T value); -
tests/zombies/gc_no_raii/bug-repro/realloc.c
r92bfda0 rdafbde8 1 1 void* realloc(void*, unsigned long int); 2 2 3 forall( otypeT)3 forall(T) 4 4 struct wrap 5 5 { … … 7 7 }; 8 8 9 forall( otypeT)9 forall(T) 10 10 static inline void realloc(wrap(T) *const this, unsigned long int size) 11 11 { -
tests/zombies/gc_no_raii/bug-repro/return.c
r92bfda0 rdafbde8 1 forall( otypeT)1 forall(T) 2 2 struct wrapper 3 3 { … … 5 5 }; 6 6 7 forall( otypeT)7 forall(T) 8 8 wrapper(T) create() 9 9 { … … 12 12 } 13 13 14 forall( otypeT)14 forall(T) 15 15 wrapper(T)* ?=?(wrapper(T)* lhs, wrapper(T)* rhs) 16 16 { -
tests/zombies/gc_no_raii/bug-repro/return_template.c
r92bfda0 rdafbde8 1 forall( otypeT)1 forall(T) 2 2 struct wrap 3 3 { … … 5 5 }; 6 6 7 forall( otypeT) void ?{}(wrap(T)* this);8 forall( otypeT) void ?{}(wrap(T)* this, wrap(T)* rhs);9 forall( otypeT) void ^?{}(wrap(T)* this);10 forall( otypeT) void ?=?(wrap(T)* this, wrap(T)* rhs);7 forall(T) void ?{}(wrap(T)* this); 8 forall(T) void ?{}(wrap(T)* this, wrap(T)* rhs); 9 forall(T) void ^?{}(wrap(T)* this); 10 forall(T) void ?=?(wrap(T)* this, wrap(T)* rhs); 11 11 12 forall( otypeT)12 forall(T) 13 13 wrap(T) test() 14 14 { -
tests/zombies/gc_no_raii/bug-repro/slow_malloc.c
r92bfda0 rdafbde8 1 1 #include <stdlib.hfa> 2 2 3 forall( otypeT)3 forall(T) 4 4 struct heap_allocator 5 5 { -
tests/zombies/gc_no_raii/bug-repro/zero.c
r92bfda0 rdafbde8 1 forall( otypeT)1 forall(T) 2 2 struct wrap 3 3 { … … 5 5 }; 6 6 7 forall( otypeT)7 forall(T) 8 8 int ?==? (wrap(T) lhs, wrap(T) rhs) 9 9 { … … 14 14 struct wrap(int) 0; 15 15 /*/ 16 forall( otypeT)16 forall(T) 17 17 struct wrap(T) 0; 18 18 //*/ -
tests/zombies/gc_no_raii/src/gc.h
r92bfda0 rdafbde8 13 13 // } 14 14 15 forall( otypeT)15 forall(T) 16 16 static inline void gcmalloc(gcpointer(T)* ptr) 17 17 { -
tests/zombies/gc_no_raii/src/gcpointers.c
r92bfda0 rdafbde8 113 113 #endif 114 114 115 forall( otypeT) void ?{}(gcpointer(T)* this) {115 forall(T) void ?{}(gcpointer(T)* this) { 116 116 (&this->internal) {}; 117 117 } 118 118 119 forall( otypeT) void ?{}(gcpointer(T)* this, void* address) {119 forall(T) void ?{}(gcpointer(T)* this, void* address) { 120 120 (&this->internal) { address }; 121 121 } 122 122 123 forall( otypeT) void ?{}(gcpointer(T)* this, gcpointer(T) other) {123 forall(T) void ?{}(gcpointer(T)* this, gcpointer(T) other) { 124 124 (&this->internal) { other.internal }; 125 125 } 126 126 127 forall( otypeT) void ^?{}(gcpointer(T)* this) {127 forall(T) void ^?{}(gcpointer(T)* this) { 128 128 ^?{}(&this->internal); 129 129 } 130 130 131 forall( otypeT) gcpointer(T) ?=?(gcpointer(T)* this, gcpointer(T) rhs) {131 forall(T) gcpointer(T) ?=?(gcpointer(T)* this, gcpointer(T) rhs) { 132 132 this->internal = rhs.internal; 133 133 return *this; … … 136 136 // forall(otype T) T *?(gcpointer(T) this); 137 137 138 forall( otypeT) T* get(gcpointer(T)* this) {138 forall(T) T* get(gcpointer(T)* this) { 139 139 return (T*)this->internal.ptr; 140 140 } 141 141 // 142 142 // //Logical operators 143 forall( otypeT) int ?!=?(gcpointer(T) this, int zero) {143 forall(T) int ?!=?(gcpointer(T) this, int zero) { 144 144 return this.internal.ptr != 0; 145 145 } -
tests/zombies/gc_no_raii/src/gcpointers.h
r92bfda0 rdafbde8 4 4 #include <stdint.h> 5 5 6 forall( dtype T)6 forall(T &) 7 7 struct gcpointer; 8 8 … … 29 29 #endif 30 30 31 forall( dtype T)31 forall(T &) 32 32 struct gcpointer 33 33 { … … 36 36 37 37 // 38 forall( otypeT) void ?{}(gcpointer(T)* this);39 forall( otypeT) void ?{}(gcpointer(T)* this, void* address);40 forall( otypeT) void ?{}(gcpointer(T)* this, gcpointer(T) other);41 forall( otypeT) void ^?{}(gcpointer(T)* this);42 forall( otypeT) gcpointer(T) ?=?(gcpointer(T)* this, gcpointer(T) rhs);38 forall(T) void ?{}(gcpointer(T)* this); 39 forall(T) void ?{}(gcpointer(T)* this, void* address); 40 forall(T) void ?{}(gcpointer(T)* this, gcpointer(T) other); 41 forall(T) void ^?{}(gcpointer(T)* this); 42 forall(T) gcpointer(T) ?=?(gcpointer(T)* this, gcpointer(T) rhs); 43 43 44 44 45 45 // forall(otype T) T *?(gcpointer(T) this); 46 forall( otypeT) T* get(gcpointer(T)* this);46 forall(T) T* get(gcpointer(T)* this); 47 47 48 48 //Logical operators 49 forall( otypeT) int ?!=?(gcpointer(T) this, int zero);50 forall( otypeT) int ?!=?(gcpointer(T) this, gcpointer(T) rhs);51 forall( otypeT) int ?==?(gcpointer(T) this, gcpointer(T) rhs);49 forall(T) int ?!=?(gcpointer(T) this, int zero); 50 forall(T) int ?!=?(gcpointer(T) this, gcpointer(T) rhs); 51 forall(T) int ?==?(gcpointer(T) this, gcpointer(T) rhs); -
tests/zombies/gc_no_raii/src/tools.h
r92bfda0 rdafbde8 12 12 // } 13 13 14 trait has_equal( otypeT)14 trait has_equal(T) 15 15 { 16 16 signed int ?==?(T a, T b); 17 17 }; 18 18 19 trait InputIterator_t( otype T, otypeInputIterator)19 trait InputIterator_t(T, InputIterator) 20 20 { 21 21 signed int ?==?(InputIterator a, InputIterator b); … … 26 26 }; 27 27 28 forall( otype T | has_equal(T), otypeInputIterator | InputIterator_t(T, InputIterator))28 forall(T | has_equal(T), InputIterator | InputIterator_t(T, InputIterator)) 29 29 static inline InputIterator find( InputIterator first, const InputIterator* const last, T val) 30 30 {
Note: See TracChangeset
for help on using the changeset viewer.