Changeset 2a301ff for libcfa/src/bits
- Timestamp:
- Aug 31, 2023, 11:31:15 PM (2 years ago)
- Branches:
- master
- Children:
- 950c58e
- Parents:
- 92355883 (diff), 686912c (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:
- libcfa/src/bits
- Files:
-
- 5 edited
- 1 moved
-
algorithm.hfa (modified) (8 diffs)
-
collections.hfa (moved) (moved from libcfa/src/bits/containers.hfa ) (1 diff)
-
debug.cfa (modified) (2 diffs)
-
queue.hfa (modified) (1 diff)
-
weakso_locks.cfa (modified) (1 diff)
-
weakso_locks.hfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/algorithm.hfa
r92355883 r2a301ff 9 9 // Author : Thierry Delisle 10 10 // Created On : Mon Oct 30 13:37:34 2017 11 // Last Modified By : --12 // Last Modified On : --13 // Update Count : 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 08:25:29 2023 13 // Update Count : 3 14 14 // 15 15 … … 17 17 18 18 #ifdef SAFE_SORT 19 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort2( T * arr );20 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort3( T * arr );21 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort4( T * arr );22 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort5( T * arr );23 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort6( T * arr );24 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sortN( T * arr, size_t dim );19 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort2( T * arr ); 20 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort3( T * arr ); 21 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort4( T * arr ); 22 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort5( T * arr ); 23 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort6( T * arr ); 24 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sortN( T * arr, size_t dim ); 25 25 26 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )26 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) 27 27 static inline void __libcfa_small_sort( T * arr, size_t dim ) { 28 28 switch( dim ) { … … 41 41 #define SWAP(x,y) { T a = min(arr[x], arr[y]); T b = max(arr[x], arr[y]); arr[x] = a; arr[y] = b;} 42 42 43 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )43 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) 44 44 static inline void __libcfa_small_sort2( T * arr ) { 45 45 SWAP(0, 1); 46 46 } 47 47 48 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )48 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) 49 49 static inline void __libcfa_small_sort3( T * arr ) { 50 50 SWAP(1, 2); … … 53 53 } 54 54 55 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )55 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) 56 56 static inline void __libcfa_small_sort4( T * arr ) { 57 57 SWAP(0, 1); … … 62 62 } 63 63 64 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )64 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) 65 65 static inline void __libcfa_small_sort5( T * arr ) { 66 66 SWAP(0, 1); … … 75 75 } 76 76 77 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )77 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) 78 78 static inline void __libcfa_small_sort6( T * arr ) { 79 79 SWAP(1, 2); … … 91 91 } 92 92 93 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )93 forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) 94 94 static inline void __libcfa_small_sortN( T * arr, size_t dim ) { 95 int i, j; 96 for (i = 1; i < dim; i++) { 95 for ( i; 1 ~ dim ) { 97 96 T tmp = arr[i]; 98 for (j = i; j >= 1 && tmp < arr[j-1]; j--) { 97 int j; 98 for ( j = i; j >= 1 && tmp < arr[j-1]; j--) { 99 99 arr[j] = arr[j-1]; 100 100 } … … 175 175 176 176 static inline void __libcfa_small_sortN( void* * arr, size_t dim ) { 177 int i, j;178 for (i = 1; i < dim; i++) {179 void* tmp = arr[i];177 for ( i; 1 ~ dim ) { 178 void * tmp = arr[i]; 179 int j; 180 180 for (j = i; j >= 1 && tmp < arr[j-1]; j--) { 181 181 arr[j] = arr[j-1]; -
libcfa/src/bits/collections.hfa
r92355883 r2a301ff 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // bits/co ntainers.hfa -- Intrusive generic containers.hfa7 // bits/collections.hfa -- Intrusive generic collections 8 8 // 9 9 // Author : Thierry Delisle 10 10 // Created On : Tue Oct 31 16:38:50 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 2 11:33:08202313 // Update Count : 2912 // Last Modified On : Wed Aug 30 21:26:39 2023 13 // Update Count : 30 14 14 15 15 #pragma once -
libcfa/src/bits/debug.cfa
r92355883 r2a301ff 10 10 // Created On : Thu Mar 30 12:30:01 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Apr 22 18:20:26 202213 // Update Count : 1 312 // Last Modified On : Sat Jul 22 08:17:27 2023 13 // Update Count : 14 14 14 // 15 15 … … 33 33 in_buffer += count; 34 34 35 for ( ;;) {35 for () { 36 36 retcode = write( fd, in_buffer, len - count ); 37 37 -
libcfa/src/bits/queue.hfa
r92355883 r2a301ff 91 91 T * prev = 0p; 92 92 T * curr = (T *)root; 93 for ( ;;) {93 for () { 94 94 if ( &n == curr ) { // found => remove 95 95 if ( (T *)root == &n ) { -
libcfa/src/bits/weakso_locks.cfa
r92355883 r2a301ff 30 30 bool register_select( blocking_lock & this, select_node & node ) { return false; } 31 31 bool unregister_select( blocking_lock & this, select_node & node ) { return false; } 32 void on_selected( blocking_lock & this, select_node & node ) {}32 bool on_selected( blocking_lock & this, select_node & node ) { return true; } 33 33 -
libcfa/src/bits/weakso_locks.hfa
r92355883 r2a301ff 20 20 #include "bits/locks.hfa" 21 21 #include "bits/sequence.hfa" 22 #include "bits/co ntainers.hfa"23 #include "co ntainers/list.hfa"22 #include "bits/collections.hfa" 23 #include "collections/list.hfa" 24 24 25 25 struct select_node; … … 62 62 bool register_select( blocking_lock & this, select_node & node ) OPTIONAL_THREAD; 63 63 bool unregister_select( blocking_lock & this, select_node & node ) OPTIONAL_THREAD; 64 void on_selected( blocking_lock & this, select_node & node ) OPTIONAL_THREAD; 64 bool on_selected( blocking_lock & this, select_node & node ) OPTIONAL_THREAD; 65 blocking_lock __CFA_select_get_type( blocking_lock this ) OPTIONAL_THREAD; 65 66 66 67 //---------- … … 80 81 static inline bool register_select( multiple_acquisition_lock & this, select_node & node ) { return register_select( (blocking_lock &)this, node ); } 81 82 static inline bool unregister_select( multiple_acquisition_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); } 82 static inline void on_selected( multiple_acquisition_lock & this, select_node & node ) { on_selected( (blocking_lock &)this, node ); } 83 static inline bool on_selected( multiple_acquisition_lock & this, select_node & node ) { return on_selected( (blocking_lock &)this, node ); } 84 multiple_acquisition_lock __CFA_select_get_type( multiple_acquisition_lock this );
Note:
See TracChangeset
for help on using the changeset viewer.