Changeset 09da82d
- Timestamp:
- Dec 31, 2020, 5:28:42 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:
- 1958fec
- Parents:
- 7583c02
- Location:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/memory.cfa
r7583c02 r09da82d 66 66 forall(dtype T | sized(T), ttype Args | { void ?{}(T&, Args); }) 67 67 void ?{}(counter_ptr(T) & this, Args args) { 68 this.data = new(args);68 this.data = (counter_data(T)*)new(args); 69 69 } 70 70 … … 126 126 forall(dtype T | sized(T), ttype Args | { void ?{}(T &, Args); }) 127 127 void ?{}(unique_ptr(T) & this, Args args) { 128 this.data = new(args);128 this.data = (T *)new(args); 129 129 } 130 130 -
libcfa/src/stdlib.hfa
r7583c02 r09da82d 267 267 static inline forall( dtype T | sized(T), ttype TT | { void ?{}( T &, TT ); } ) 268 268 T * new( TT p ) { 269 return &(* malloc()){ p }; // run constructor269 return &(*(T *)malloc()){ p }; // run constructor 270 270 } // new 271 271
Note: See TracChangeset
for help on using the changeset viewer.