Changeset ab652e7


Ignore:
Timestamp:
Jun 18, 2020, 10:00:33 PM (15 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
df733ed
Parents:
b8e3941
Message:

Hashtable demo got trac 184 workaround applied.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/hashtable.cfa

    rb8e3941 rab652e7  
    2323};
    2424
    25 forall( otype K, dtype tN, dtype tE | $dlistable(tN, tE) | hkey(K, tN) | { void defaultResumptionHandler(ht_fill_limit_crossed &); } ) {
     25forall( otype K, dtype tN, dtype tE | $dlistable(tN, tE) | hkey(K, tN) ) {
    2626
    2727    struct hashtable {
     
    3333        float ff_next_warn_up;
    3434
    35         void (*__stashed_defaultResumptionHandler) (ht_fill_limit_crossed &);
     35        void (*defaultResumptionHandler) (ht_fill_limit_crossed &);
    3636    };
    3737
    3838    void ?{}( hashtable(K, tN, tE) & this ) = void;
    39 //    void ?{}( hashtable(K, tN, tE) & this, size_t, dlist(tN, tE)* ) = void;
     39}
     40
     41forall( otype K, dtype tN, dtype tE | $dlistable(tN, tE) | hkey(K, tN) | { void defaultResumptionHandler(ht_fill_limit_crossed &); } ) {
    4042
    4143    void ?{}( hashtable(K, tN, tE) & this, size_t n_buckets, dlist(tN, tE) *buckets ) {
     
    4749        this.ff_next_warn_up = 0.5;
    4850
    49         this.__stashed_defaultResumptionHandler = defaultResumptionHandler;
     51        this.defaultResumptionHandler = defaultResumptionHandler;
    5052
    5153        for ( i; n_buckets ) {
     
    7981
    8082    void check_ff_warning( hashtable(K, tN, tE) & this ) with (this) {
    81         void (*defaultResumptionHandler) (ht_fill_limit_crossed &) = __stashed_defaultResumptionHandler;
    8283        if (fill_frac(this) > ff_next_warn_up) {
    8384            throwResume (ht_fill_limit_crossed){};
Note: See TracChangeset for help on using the changeset viewer.