aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/utils/hash.cpp
blob: b0bc284d4f8368db406335645f676ed455ec4960 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "hash.h"
#include <util/system/getpid.h>
#include <util/system/env.h>

namespace NYql {

#ifndef NDEBUG
size_t VaryingHash(size_t src) {
    struct TPid {
        size_t Value;

        TPid()
            : Value(GetEnv("YQL_MUTATE_HASHCODE") ? IntHash(GetPID()) : 0)
        {}
    };

    return Singleton<TPid>()->Value ^ src;
}
#endif

}