Changeset f5478c8 for src/libcfa
- Timestamp:
- Nov 24, 2017, 8:57:00 PM (7 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:
- 2b716ec
- Parents:
- 50abab9 (diff), 3de176d (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. - Location:
- src/libcfa
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel
r50abab9 rf5478c8 108 108 #ifdef __CFA_DEBUG__ 109 109 // Last function to enable preemption on this processor 110 c har * last_enable;110 const char * last_enable; 111 111 #endif 112 112 }; -
src/libcfa/concurrency/monitor.c
r50abab9 rf5478c8 823 823 this.monitor_count = thrd->monitors.size; 824 824 825 this.monitors = malloc( this.monitor_count * sizeof( *this.monitors ) );825 this.monitors = (monitor_desc **)malloc( this.monitor_count * sizeof( *this.monitors ) ); 826 826 for( int i = 0; i < this.monitor_count; i++ ) { 827 827 this.monitors[i] = thrd->monitors[i]; -
src/libcfa/stdhdr/stddef.h
r50abab9 rf5478c8 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. 6 // 7 // stddef.h -- 8 // 6 // 7 // stddef.h -- 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Mon Jul 4 23:25:26 2016 … … 12 12 // Last Modified On : Tue Jul 5 20:40:01 2016 13 13 // Update Count : 12 14 // 14 // 15 15 16 16 extern "C" { 17 #include_next <stddef.h> // has internal check for multiple expansion 17 #include_next <stddef.h> // has internal check for multiple expansion 18 #undef NULL 19 #define NULL 0 // define NULL as 0 rather than (void*)0 to take advantage of zero_t 18 20 } // extern "C" 19 21 -
src/libcfa/stdlib
r50abab9 rf5478c8 77 77 //printf( "X8\n" ); 78 78 T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 79 return memset( ptr, (int)fill, sizeof(T) ); // initial with fill value79 return (T *)memset( ptr, (int)fill, sizeof(T) ); // initial with fill value 80 80 } // alloc 81 81 … … 87 87 //printf( "X10\n" ); 88 88 T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc 89 return memset( ptr, (int)fill, dim * sizeof(T) );89 return (T *)memset( ptr, (int)fill, dim * sizeof(T) ); 90 90 } // alloc 91 91 92 92 static inline forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim ) { 93 93 //printf( "X11\n" ); 94 return ( void *)realloc( (void *)ptr, dim * (size_t)sizeof(T) ); // C realloc94 return (T *)(void *)realloc( (void *)ptr, dim * (size_t)sizeof(T) ); // C realloc 95 95 } // alloc 96 96 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim, char fill ); … … 103 103 //printf( "X14\n" ); 104 104 T * ptr = (T *)memalign( align, sizeof(T) ); 105 return memset( ptr, (int)fill, sizeof(T) );105 return (T *)memset( ptr, (int)fill, sizeof(T) ); 106 106 } // align_alloc 107 107 … … 113 113 //printf( "X16\n" ); 114 114 T * ptr = (T *)memalign( align, dim * sizeof(T) ); 115 return memset( ptr, (int)fill, dim * sizeof(T) );115 return (T *)memset( ptr, (int)fill, dim * sizeof(T) ); 116 116 } // align_alloc 117 117 … … 120 120 static inline forall( dtype T | sized(T) ) T * memset( T * dest, char c ) { 121 121 //printf( "X17\n" ); 122 return memset( dest, c, sizeof(T) );122 return (T *)memset( dest, c, sizeof(T) ); 123 123 } // memset 124 124 extern "C" { void * memcpy( void * dest, const void * src, size_t size ); } // use default C routine for void * 125 125 static inline forall( dtype T | sized(T) ) T * memcpy( T * dest, const T * src ) { 126 126 //printf( "X18\n" ); 127 return memcpy( dest, src, sizeof(T) );127 return (T *)memcpy( dest, src, sizeof(T) ); 128 128 } // memcpy 129 129 … … 131 131 static inline forall( dtype T | sized(T) ) T * memset( T dest[], size_t dim, char c ) { 132 132 //printf( "X19\n" ); 133 return ( void *)memset( dest, c, dim * sizeof(T) ); // C memset133 return (T *)(void *)memset( dest, c, dim * sizeof(T) ); // C memset 134 134 } // memset 135 135 static inline forall( dtype T | sized(T) ) T * memcpy( T dest[], const T src[], size_t dim ) { 136 136 //printf( "X20\n" ); 137 return ( void *)memcpy( dest, src, dim * sizeof(T) ); // C memcpy137 return (T *)(void *)memcpy( dest, src, dim * sizeof(T) ); // C memcpy 138 138 } // memcpy 139 139
Note: See TracChangeset
for help on using the changeset viewer.