Changeset 8be729f for libcfa/src/memory.cfa
- Timestamp:
- Feb 1, 2021, 4:23:55 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 85871478
- Parents:
- f99f5ba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/memory.cfa
rf99f5ba r8be729f 10 10 // Created On : Tue Jun 2 16:48:00 2020 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Jun 3 12:30:00 202013 // Update Count : 012 // Last Modified On : Mon Feb 1 16:10:00 2021 13 // Update Count : 1 14 14 // 15 15 … … 56 56 } 57 57 58 forall(T & | sized(T) | { void ^?{}(T &); })58 forall(T & | sized(T)) 59 59 void ?{}(counter_ptr(T) & this, counter_ptr(T) that) { 60 60 // `that` is a copy but it should have neither a constructor 61 61 // nor destructor run on it so it shouldn't need adjustment. 62 internal_decrement(this);62 //internal_decrement(this); 63 63 internal_copy(this, that); 64 64 } … … 66 66 forall(T & | sized(T), Args... | { void ?{}(T&, Args); }) 67 67 void ?{}(counter_ptr(T) & this, Args args) { 68 this.data = (counter_data(T)*)new(args); 68 this.data = malloc(); 69 this.data->counter = 1; 70 (this.data->object){args}; 69 71 } 70 72 … … 126 128 forall(T & | sized(T), Args... | { void ?{}(T &, Args); }) 127 129 void ?{}(unique_ptr(T) & this, Args args) { 128 this.data = (T *)new(args); 130 this.data = malloc(); 131 (*this.data){args}; 129 132 } 130 133
Note: See TracChangeset
for help on using the changeset viewer.