Changeset cfbc56ec for libcfa/src
- Timestamp:
- Jan 10, 2024, 12:01:02 PM (10 months ago)
- Branches:
- master
- Children:
- 4d689e2, b262cb3
- Parents:
- 40002c5
- Location:
- libcfa/src
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/Makefile.am
r40002c5 rcfbc56ec 48 48 math.trait.hfa \ 49 49 math.hfa \ 50 raii.hfa \ 50 51 time_t.hfa \ 51 52 virtual_dtor.hfa \ -
libcfa/src/collections/array.hfa
r40002c5 rcfbc56ec 131 131 132 132 static inline void __taglen( tag(arpk(N, S, Timmed, Tbase)), tag(N) ) {} 133 134 // workaround #226 (and array relevance thereof demonstrated in mike102/otype-slow-ndims.cfa) 135 static inline void ?{}( arpk(N, S, Timmed, Tbase) & this ) { 136 void ?{}( S (&inner)[N] ) {} 137 ?{}(this.strides); 138 } 139 static inline void ^?{}( arpk(N, S, Timmed, Tbase) & this ) { 140 void ^?{}( S (&inner)[N] ) {} 141 ^?{}(this.strides); 133 } 134 135 // RAII pattern has workarounds for 136 // - Trac 226: Simplest handling would be, require immediate element to be otype, let autogen 137 // raii happen. Performance on even a couple dimensions is unacceptable because of exponential 138 // thunk creation: ?{}() needs all four otype funcs from next level, so does ^?{}(), so do the 139 // other two. This solution offers ?{}() that needs only ?{}(), and similar for ^?{}. 140 141 forall( [N], S & | sized(S), Timmed &, Tbase & | { void ?{}( Timmed & ); } ) 142 static inline void ?{}( arpk(N, S, Timmed, Tbase) & this ) { 143 void ?{}( S (&)[N] ) {} 144 ?{}(this.strides); 145 146 for (i; N) ?{}( (Timmed &) this.strides[i] ); 147 } 148 149 forall( [N], S & | sized(S), Timmed &, Tbase & | { void ^?{}( Timmed & ); } ) 150 static inline void ^?{}( arpk(N, S, Timmed, Tbase) & this ) { 151 void ^?{}( S (&)[N] ) {} 152 ^?{}(this.strides); 153 154 for (i; N ) { 155 ^?{}( (Timmed &) this.strides[N-i-1] ); 142 156 } 143 157 } … … 147 161 // 148 162 149 forall( Te )163 forall( Te * ) 150 164 static inline Te mkar_( tag(Te) ) {} 151 165
Note: See TracChangeset
for help on using the changeset viewer.