Changeset 627f585 for src/libcfa
- Timestamp:
- Jan 10, 2017, 2:32:33 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- dd0c97b
- Parents:
- f831177
- Location:
- src/libcfa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/stdlib
rf831177 r627f585 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // stdlib -- 7 // stdlib -- 8 8 // 9 9 // Author : Peter A. Buhr … … 44 44 void free( void * ptr ); 45 45 } // extern "C" 46 47 forall( otype T, ttype Params | { void ?{}(T *, Params); } ) T * new( Params p ); 48 forall( dtype T | { void ^?{}(T *); } ) void delete( T * ptr ); 49 46 50 47 51 //--------------------------------------- -
src/libcfa/stdlib.c
rf831177 r627f585 78 78 } // posix_memalign 79 79 80 forall( otype T, ttype Params | { void ?{}(T *, Params); } ) 81 T * new( Params p ) { 82 return ((T*)malloc()){ p }; 83 } 84 85 forall( dtype T | { void ^?{}(T *); } ) 86 void delete( T * ptr ) { 87 if ( ptr ) { 88 ^ptr{}; 89 free( ptr ); 90 } 91 } 92 80 93 //--------------------------------------- 81 94
Note: See TracChangeset
for help on using the changeset viewer.