Ignore:
Timestamp:
Feb 2, 2021, 9:56:41 PM (9 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
3d67f83
Parents:
144fa5c (diff), 1c1c180 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/memory.cfa

    r144fa5c r3b402339  
    1010// Created On       : Tue Jun  2 16:48:00 2020
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Jun  3 12:30:00 2020
    13 // Update Count     : 0
     12// Last Modified On : Mon Feb  1 16:10:00 2021
     13// Update Count     : 1
    1414//
    1515
     
    5656}
    5757
    58 forall(T & | sized(T) | { void ^?{}(T &); })
     58forall(T & | sized(T))
    5959void ?{}(counter_ptr(T) & this, counter_ptr(T) that) {
    6060        // `that` is a copy but it should have neither a constructor
    6161        // nor destructor run on it so it shouldn't need adjustment.
    62         internal_decrement(this);
    6362        internal_copy(this, that);
    6463}
     
    6665forall(T & | sized(T), Args... | { void ?{}(T&, Args); })
    6766void ?{}(counter_ptr(T) & this, Args args) {
    68         this.data = (counter_data(T)*)new(args);
     67        this.data = malloc();
     68        this.data->counter = 1;
     69        (this.data->object){args};
    6970}
    7071
     
    126127forall(T & | sized(T), Args... | { void ?{}(T &, Args); })
    127128void ?{}(unique_ptr(T) & this, Args args) {
    128         this.data = (T *)new(args);
     129        this.data = malloc();
     130        (*this.data){args};
    129131}
    130132
Note: See TracChangeset for help on using the changeset viewer.