summaryrefslogtreecommitdiffstats
path: root/yql/essentials/utils/hash.cpp
blob: 803dcb3b4b862f01935eba1c220761772a5e0c3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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

} // namespace NYql