Changeset a094f13 for libcfa/src
- Timestamp:
- Oct 1, 2019, 11:40:52 AM (5 years ago)
- 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:
- 73fad25
- Parents:
- 722c0848 (diff), 7df201c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/stdlib.hfa
r722c0848 ra094f13 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jul 23 14:14:59201913 // Update Count : 3 7312 // Last Modified On : Fri Sep 27 12:09:18 2019 13 // Update Count : 381 14 14 // 15 15 … … 81 81 } // alloc 82 82 83 T * alloc( T & fill ) { 84 return (T *)memcpy( (T *)alloc(), &fill, sizeof(T) ); // initialize with fill value 85 } // alloc 86 83 87 T * alloc( size_t dim ) { 84 88 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc … … 88 92 T * alloc( size_t dim, char fill ) { 89 93 return (T *)memset( (T *)alloc( dim ), (int)fill, dim * sizeof(T) ); // initialize with fill value 94 } // alloc 95 96 T * alloc( size_t dim, T & fill ) { 97 T * r = (T *)alloc( dim ); 98 for ( i; dim ) { memcpy( &r[i], &fill, sizeof(T) ); } // initialize with fill value 99 return r; 100 } // alloc 101 102 T * alloc( size_t dim, T fill[] ) { 103 return (T *)memcpy( (T *)alloc( dim ), fill, dim * sizeof(T) ); // initialize with fill value 90 104 } // alloc 91 105
Note: See TracChangeset
for help on using the changeset viewer.