Changeset 09da82d


Ignore:
Timestamp:
Dec 31, 2020, 5:28:42 PM (4 years ago)
Author:
Fangren Yu <f37yu@…>
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
Message:

workaround for a ttype resolve time issue

Location:
libcfa/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/memory.cfa

    r7583c02 r09da82d  
    6666forall(dtype T | sized(T), ttype Args | { void ?{}(T&, Args); })
    6767void ?{}(counter_ptr(T) & this, Args args) {
    68         this.data = new(args);
     68        this.data = (counter_data(T)*)new(args);
    6969}
    7070
     
    126126forall(dtype T | sized(T), ttype Args | { void ?{}(T &, Args); })
    127127void ?{}(unique_ptr(T) & this, Args args) {
    128         this.data = new(args);
     128        this.data = (T *)new(args);
    129129}
    130130
  • libcfa/src/stdlib.hfa

    r7583c02 r09da82d  
    267267static inline forall( dtype T | sized(T), ttype TT | { void ?{}( T &, TT ); } )
    268268T * new( TT p ) {
    269         return &(*malloc()){ p };                                                       // run constructor
     269        return &(*(T *)malloc()){ p };                                                  // run constructor
    270270} // new
    271271
Note: See TracChangeset for help on using the changeset viewer.