Changes in libcfa/src/memory.cfa [85871478:fd54fef]
- File:
-
- 1 edited
-
libcfa/src/memory.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/memory.cfa
r85871478 rfd54fef 10 10 // Created On : Tue Jun 2 16:48:00 2020 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Feb 1 16:10:00 202113 // Update Count : 112 // Last Modified On : Tue Jun 3 12:30:00 2020 13 // Update Count : 0 14 14 // 15 15 … … 56 56 } 57 57 58 forall(T & | sized(T) )58 forall(T & | sized(T) | { void ^?{}(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 63 internal_copy(this, that); 63 64 } … … 65 66 forall(T & | sized(T), Args... | { void ?{}(T&, Args); }) 66 67 void ?{}(counter_ptr(T) & this, Args args) { 67 this.data = malloc(); 68 this.data->counter = 1; 69 (this.data->object){args}; 68 this.data = (counter_data(T)*)new(args); 70 69 } 71 70 … … 127 126 forall(T & | sized(T), Args... | { void ?{}(T &, Args); }) 128 127 void ?{}(unique_ptr(T) & this, Args args) { 129 this.data = malloc(); 130 (*this.data){args}; 128 this.data = (T *)new(args); 131 129 } 132 130
Note:
See TracChangeset
for help on using the changeset viewer.