Ignore:
Timestamp:
Feb 1, 2021, 4:23:55 PM (4 years ago)
Author:
Andrew Beach <ajbeach@…>
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
Message:

That should fix the memory module. Simply removed all the special features.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/memory.cfa

    rf99f5ba r8be729f  
    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);
     62        //internal_decrement(this);
    6363        internal_copy(this, that);
    6464}
     
    6666forall(T & | sized(T), Args... | { void ?{}(T&, Args); })
    6767void ?{}(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};
    6971}
    7072
     
    126128forall(T & | sized(T), Args... | { void ?{}(T &, Args); })
    127129void ?{}(unique_ptr(T) & this, Args args) {
    128         this.data = (T *)new(args);
     130        this.data = malloc();
     131        (*this.data){args};
    129132}
    130133
Note: See TracChangeset for help on using the changeset viewer.