Ignore:
Timestamp:
Jan 10, 2017, 2:32:33 PM (5 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
dd0c97b
Parents:
f831177
Message:

moved new and delete to stdlib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/stdlib.c

    rf831177 r627f585  
    7878} // posix_memalign
    7979
     80forall( otype T, ttype Params | { void ?{}(T *, Params); } )
     81T * new( Params p ) {
     82        return ((T*)malloc()){ p };
     83}
     84
     85forall( dtype T | { void ^?{}(T *); } )
     86void delete( T * ptr ) {
     87  if ( ptr ) {
     88    ^ptr{};
     89    free( ptr );
     90  }
     91}
     92
    8093//---------------------------------------
    8194
Note: See TracChangeset for help on using the changeset viewer.