grpc
src
core
lib
slice
slice_refcount.cc
Go to the documentation of this file.
1
// Copyright 2021 gRPC authors.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#include <
grpc/support/port_platform.h
>
16
17
#include "
src/core/lib/slice/slice_refcount.h
"
18
19
#include <chrono>
20
21
namespace
grpc_core
{
22
23
uint32_t
g_hash_seed
= []() {
24
auto
now
=
std::chrono::system_clock::now
();
25
auto
now_since_epoch =
now
.time_since_epoch();
26
auto
now_ns =
27
std::chrono::duration_cast<std::chrono::nanoseconds>(now_since_epoch);
28
return
static_cast<
uint32_t
>
(now_ns.count());
29
}();
30
31
}
// namespace grpc_core
32
33
void
grpc_test_only_set_slice_hash_seed
(
uint32_t
seed
) {
34
grpc_core::g_hash_seed
=
seed
;
35
}
now
static double now(void)
Definition:
test/core/fling/client.cc:130
grpc_core
Definition:
call_metric_recorder.h:31
seed
static const uint8_t seed[20]
Definition:
dsa_test.cc:79
uint32_t
unsigned int uint32_t
Definition:
stdint-msvc2008.h:80
grpc_test_only_set_slice_hash_seed
void grpc_test_only_set_slice_hash_seed(uint32_t seed)
Definition:
slice_refcount.cc:33
slice_refcount.h
grpc_core::g_hash_seed
uint32_t g_hash_seed
Definition:
slice_refcount.cc:23
port_platform.h
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:13