~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/ut0rnd.ic

Merge Monty - Change the requirement from either libinnodb to libhaildb. Also, tied it to version 2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1994, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
85
85
/*==================*/
86
86
{
87
87
        ulint   rnd;
 
88
        ulint   n_bits;
 
89
 
 
90
        n_bits = 8 * sizeof(ulint);
88
91
 
89
92
        ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
90
93
 
149
152
        ulint    key,           /*!< in: value to be hashed */
150
153
        ulint    table_size)    /*!< in: hash table size */
151
154
{
152
 
        ut_ad(table_size);
153
155
        key = key ^ UT_HASH_RANDOM_MASK2;
154
156
 
155
157
        return(key % table_size);
170
172
}
171
173
 
172
174
/*************************************************************//**
173
 
Folds a 64-bit integer.
 
175
Folds a dulint.
174
176
@return folded value */
175
177
UNIV_INLINE
176
178
ulint
177
 
ut_fold_ull(
178
 
/*========*/
179
 
        ib_uint64_t     d)      /*!< in: 64-bit integer */
 
179
ut_fold_dulint(
 
180
/*===========*/
 
181
        dulint  d)      /*!< in: dulint */
180
182
{
181
 
        return(ut_fold_ulint_pair((ulint) d & ULINT32_MASK,
182
 
                                  (ulint) (d >> 32)));
 
183
        return(ut_fold_ulint_pair(ut_dulint_get_low(d),
 
184
                                  ut_dulint_get_high(d)));
183
185
}
184
186
 
185
187
/*************************************************************//**