Ignore:
Timestamp:
Mar 6, 2020, 1:46:00 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
6b4a1bf
Parents:
63aea5a
Message:

update comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/stdlib.hfa

    r63aea5a rca7949b  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  4 08:27:01 2020
    13 // Update Count     : 401
     12// Last Modified On : Thu Mar  5 11:29:06 2020
     13// Update Count     : 407
    1414//
    1515
     
    2121#include <stdlib.h>                                                                             // *alloc, strto*, ato*
    2222
     23// Reduce includes by explicitly defining these routines.
    2324extern "C" {
    2425        void * memalign( size_t align, size_t size );           // malloc.h
     26    void * cmemalign( size_t alignment, size_t noOfElems, size_t elemSize ); // CFA heap
    2527        void * memset( void * dest, int fill, size_t size ); // string.h
    2628        void * memcpy( void * dest, const void * src, size_t size ); // string.h
    27     void * cmemalign( size_t alignment, size_t noOfElems, size_t elemSize ); // CFA heap
    2829} // extern "C"
    2930
     
    4041
    4142static inline forall( dtype T | sized(T) ) {
    42         // C dynamic allocation
     43        // Cforall safe equivalents, i.e., implicit size specification
    4344
    4445        T * malloc( void ) {
     
    7273        } // posix_memalign
    7374
    74         // Cforall dynamic allocation
     75        // Cforall safe general allocation, fill, resize, array
    7576
    7677        T * alloc( void ) {
     
    159160
    160161static inline forall( dtype T | sized(T) ) {
    161         // data, non-array types
     162        // Cforall safe initialization/copy, i.e., implicit size specification, non-array types
    162163        T * memset( T * dest, char fill ) {
    163164                return (T *)memset( dest, fill, sizeof(T) );
     
    170171
    171172static inline forall( dtype T | sized(T) ) {
    172         // data, array types
     173        // Cforall safe initialization/copy, i.e., implicit size specification, array types
    173174        T * amemset( T dest[], char fill, size_t dim ) {
    174175                return (T *)(void *)memset( dest, fill, dim * sizeof(T) ); // C memset
     
    180181} // distribution
    181182
    182 // allocation/deallocation and constructor/destructor, non-array types
     183// Cforall allocation/deallocation and constructor/destructor, non-array types
    183184forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * new( Params p );
    184185forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void delete( T * ptr );
    185186forall( dtype T, ttype Params | sized(T) | { void ^?{}( T & ); void delete( Params ); } ) void delete( T * ptr, Params rest );
    186187
    187 // allocation/deallocation and constructor/destructor, array types
     188// Cforall allocation/deallocation and constructor/destructor, array types
    188189forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * anew( size_t dim, Params p );
    189190forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void adelete( size_t dim, T arr[] );
Note: See TracChangeset for help on using the changeset viewer.