- Timestamp:
- Jun 18, 2020, 10:00:33 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- df733ed
- Parents:
- b8e3941
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/hashtable.cfa
rb8e3941 rab652e7 23 23 }; 24 24 25 forall( otype K, dtype tN, dtype tE | $dlistable(tN, tE) | hkey(K, tN) | { void defaultResumptionHandler(ht_fill_limit_crossed &); }) {25 forall( otype K, dtype tN, dtype tE | $dlistable(tN, tE) | hkey(K, tN) ) { 26 26 27 27 struct hashtable { … … 33 33 float ff_next_warn_up; 34 34 35 void (* __stashed_defaultResumptionHandler) (ht_fill_limit_crossed &);35 void (*defaultResumptionHandler) (ht_fill_limit_crossed &); 36 36 }; 37 37 38 38 void ?{}( hashtable(K, tN, tE) & this ) = void; 39 // void ?{}( hashtable(K, tN, tE) & this, size_t, dlist(tN, tE)* ) = void; 39 } 40 41 forall( otype K, dtype tN, dtype tE | $dlistable(tN, tE) | hkey(K, tN) | { void defaultResumptionHandler(ht_fill_limit_crossed &); } ) { 40 42 41 43 void ?{}( hashtable(K, tN, tE) & this, size_t n_buckets, dlist(tN, tE) *buckets ) { … … 47 49 this.ff_next_warn_up = 0.5; 48 50 49 this. __stashed_defaultResumptionHandler = defaultResumptionHandler;51 this.defaultResumptionHandler = defaultResumptionHandler; 50 52 51 53 for ( i; n_buckets ) { … … 79 81 80 82 void check_ff_warning( hashtable(K, tN, tE) & this ) with (this) { 81 void (*defaultResumptionHandler) (ht_fill_limit_crossed &) = __stashed_defaultResumptionHandler;82 83 if (fill_frac(this) > ff_next_warn_up) { 83 84 throwResume (ht_fill_limit_crossed){};
Note: See TracChangeset
for help on using the changeset viewer.