Changeset aabb846


Ignore:
Timestamp:
Jun 5, 2020, 5:13:54 PM (4 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
9246ec6
Parents:
fe9cf9e
Message:

Added a first draft of the memory management library module.

Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/Makefile.am

    rfe9cf9e raabb846  
    4141headers_nosrc = bitmanip.hfa exception.hfa math.hfa gmp.hfa time_t.hfa clock.hfa \
    4242                bits/align.hfa bits/containers.hfa bits/defs.hfa bits/debug.hfa bits/locks.hfa containers/list.hfa containers/stackLockFree.hfa
    43 headers = common.hfa fstream.hfa heap.hfa iostream.hfa iterator.hfa limits.hfa rational.hfa time.hfa stdlib.hfa \
     43headers = common.hfa fstream.hfa heap.hfa iostream.hfa iterator.hfa limits.hfa rational.hfa \
     44                time.hfa stdlib.hfa memory.hfa \
    4445                containers/maybe.hfa containers/pair.hfa containers/result.hfa containers/vector.hfa
    4546
  • libcfa/src/Makefile.in

    rfe9cf9e raabb846  
    141141        bits/debug.cfa assert.cfa exception.c virtual.c common.cfa \
    142142        fstream.cfa heap.cfa iostream.cfa iterator.cfa limits.cfa \
    143         rational.cfa time.cfa stdlib.cfa containers/maybe.cfa \
    144         containers/pair.cfa containers/result.cfa \
     143        rational.cfa time.cfa stdlib.cfa memory.cfa \
     144        containers/maybe.cfa containers/pair.cfa containers/result.cfa \
    145145        containers/vector.cfa
    146146am__dirstamp = $(am__leading_dot)dirstamp
    147147@BUILDLIB_TRUE@am__objects_1 = common.lo fstream.lo heap.lo \
    148148@BUILDLIB_TRUE@ iostream.lo iterator.lo limits.lo rational.lo \
    149 @BUILDLIB_TRUE@ time.lo stdlib.lo containers/maybe.lo \
     149@BUILDLIB_TRUE@ time.lo stdlib.lo memory.lo containers/maybe.lo \
    150150@BUILDLIB_TRUE@ containers/pair.lo containers/result.lo \
    151151@BUILDLIB_TRUE@ containers/vector.lo
     
    238238        -type f -printf "%p ") common.hfa fstream.hfa heap.hfa \
    239239        iostream.hfa iterator.hfa limits.hfa rational.hfa time.hfa \
    240         stdlib.hfa containers/maybe.hfa containers/pair.hfa \
     240        stdlib.hfa memory.hfa containers/maybe.hfa containers/pair.hfa \
    241241        containers/result.hfa containers/vector.hfa bitmanip.hfa \
    242242        exception.hfa math.hfa gmp.hfa time_t.hfa clock.hfa \
     
    470470
    471471@BUILDLIB_FALSE@headers =
    472 @BUILDLIB_TRUE@headers = common.hfa fstream.hfa heap.hfa iostream.hfa iterator.hfa limits.hfa rational.hfa time.hfa stdlib.hfa \
     472@BUILDLIB_TRUE@headers = common.hfa fstream.hfa heap.hfa iostream.hfa iterator.hfa limits.hfa rational.hfa \
     473@BUILDLIB_TRUE@         time.hfa stdlib.hfa memory.hfa \
    473474@BUILDLIB_TRUE@         containers/maybe.hfa containers/pair.hfa containers/result.hfa containers/vector.hfa
    474475
  • libcfa/src/stdlib.cfa

    rfe9cf9e raabb846  
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Jan 28 17:10:29 2016
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun  2 08:44:46 2020
    13 // Update Count     : 499
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tue Jun  2 16:46:00 2020
     13// Update Count     : 500
    1414//
    1515
     
    7878} // new
    7979
    80 forall( dtype T | sized(T) | { void ^?{}( T & ); } )
     80forall( dtype T | { void ^?{}( T & ); } )
    8181void delete( T * ptr ) {
    8282        if ( ptr ) {                                                                            // ignore null
     
    8686} // delete
    8787
    88 forall( dtype T, ttype Params | sized(T) | { void ^?{}( T & ); void delete( Params ); } )
     88forall( dtype T, ttype Params | { void ^?{}( T & ); void delete( Params ); } )
    8989void delete( T * ptr, Params rest ) {
    90         if ( ptr ) {                                                                            // ignore null
    91                 ^(*ptr){};                                                                              // run destructor
    92                 free( ptr );
    93         } // if
     90        delete( ptr );
    9491        delete( rest );
    9592} // delete
  • libcfa/src/stdlib.hfa

    rfe9cf9e raabb846  
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Jan 28 17:12:35 2016
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun  2 09:05:16 2020
    13 // Update Count     : 450
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tue Jun  2 16:47:00 2020
     13// Update Count     : 451
    1414//
    1515
     
    229229// Cforall allocation/deallocation and constructor/destructor, non-array types
    230230forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * new( Params p );
    231 forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void delete( T * ptr );
    232 forall( dtype T, ttype Params | sized(T) | { void ^?{}( T & ); void delete( Params ); } ) void delete( T * ptr, Params rest );
     231forall( dtype T | { void ^?{}( T & ); } ) void delete( T * ptr );
     232forall( dtype T, ttype Params | { void ^?{}( T & ); void delete( Params ); } ) void delete( T * ptr, Params rest );
    233233
    234234// Cforall allocation/deallocation and constructor/destructor, array types
Note: See TracChangeset for help on using the changeset viewer.