components/top/patches/02.hash-c.patch
changeset 127 3e3c266b3a81
equal deleted inserted replaced
126:1cbfcafbc1e9 127:3e3c266b3a81
       
     1 #
       
     2 # This patch was included to address
       
     3 #    6893978 top segfaults with high thread ids
       
     4 #
       
     5 *** top-3.8beta1/hash.c-old  Thu Jul  2 15:30:55 2009
       
     6 --- top-3.8beta1/hash.c      Thu Jul  2 15:48:39 2009
       
     7 ***************
       
     8 *** 1354,1360 ****
       
     9       hi->value = value;
       
    10 
       
    11       /* hash to the bucket */
       
    12 !     bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]);
       
    13 
       
    14       /* walk the list to make sure we do not have a duplicate */
       
    15       ll = &(bucket->list);
       
    16 --- 1354,1360 ----
       
    17       hi->value = value;
       
    18 
       
    19       /* hash to the bucket */
       
    20 !     bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)]);
       
    21 
       
    22       /* walk the list to make sure we do not have a duplicate */
       
    23       ll = &(bucket->list);
       
    24 ***************
       
    25 *** 1408,1414 ****
       
    26       pidthr_t k1;
       
    27 
       
    28       /* find the bucket */
       
    29 !     bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]);
       
    30 
       
    31       /* walk the list until we find the existing item */
       
    32       ll = &(bucket->list);
       
    33 --- 1408,1414 ----
       
    34       pidthr_t k1;
       
    35 
       
    36       /* find the bucket */
       
    37 !     bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)]);
       
    38 
       
    39       /* walk the list until we find the existing item */
       
    40       ll = &(bucket->list);
       
    41 ***************
       
    42 *** 1460,1466 ****
       
    43       pidthr_t k1;
       
    44 
       
    45       result = NULL;
       
    46 !     if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != NULL)
       
    47       {
       
    48         ll = &(bucket->list);
       
    49         li = LL_FIRST(ll);
       
    50 --- 1460,1466 ----
       
    51       pidthr_t k1;
       
    52 
       
    53       result = NULL;
       
    54 !     if ((bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)])) != NULL)
       
    55       {
       
    56         ll = &(bucket->list);
       
    57         li = LL_FIRST(ll);
       
    58 ***************
       
    59 *** 1499,1505 ****
       
    60       pidthr_t k1;
       
    61 
       
    62       result = NULL;
       
    63 !     if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != NULL)
       
    64       {
       
    65         ll = &(bucket->list);
       
    66         li = LL_FIRST(ll);
       
    67 --- 1499,1505 ----
       
    68       pidthr_t k1;
       
    69 
       
    70       result = NULL;
       
    71 !     if ((bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)])) != NULL)
       
    72       {
       
    73         ll = &(bucket->list);
       
    74         li = LL_FIRST(ll);
       
    75 
       
    76 
       
    77 
       
    78 
       
    79