aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/transport/static_metadata.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-11-30 17:05:54 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-11-30 17:05:54 -0800
commitddea41e666e2c23a3f1a38e0452e541baa6dddd3 (patch)
treeaa7ff86e8327ab52cabe088f2eaf05b94155ebe3 /src/core/lib/transport/static_metadata.c
parent36b3135929cf1561d35039fc9e04e038f5351ed7 (diff)
Remove code, rely on a pip installable module to codegen
Diffstat (limited to 'src/core/lib/transport/static_metadata.c')
-rw-r--r--src/core/lib/transport/static_metadata.c62
1 files changed, 28 insertions, 34 deletions
diff --git a/src/core/lib/transport/static_metadata.c b/src/core/lib/transport/static_metadata.c
index abd5a91eff..ee1e22b2b2 100644
--- a/src/core/lib/transport/static_metadata.c
+++ b/src/core/lib/transport/static_metadata.c
@@ -429,47 +429,41 @@ uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8};
-#define ELEMS_PHASHLEN 0x40
-#define ELEMS_PHASHNKEYS 81
-#define ELEMS_PHASHRANGE 128
-#define ELEMS_PHASHSALT 0x9e3779b9
-
-static const uint8_t elems_tab[] = {
- 20, 1, 0, 61, 61, 34, 10, 16, 0, 0, 0, 0, 34, 61, 0, 1,
- 0, 0, 0, 61, 0, 88, 0, 4, 0, 47, 0, 47, 12, 7, 0, 16,
- 51, 87, 76, 4, 79, 10, 70, 47, 76, 61, 71, 88, 0, 88, 0, 47,
- 0, 16, 0, 83, 0, 57, 0, 75, 0, 42, 0, 90, 0, 42, 70, 0,
-};
-
-static uint32_t elems_phash(uint32_t val) {
- val += (uint32_t)-11;
-
- uint32_t a, b, rsl;
-
- b = (val & 0x3f);
- a = ((val << 18) >> 26);
- rsl = (a ^ elems_tab[b]);
- return rsl;
+static const int8_t elems_r[] = {
+ 10, 8, -3, 0, 9, 21, -76, 22, 0, 10, -7, 20, 0, 19, 18, 17,
+ 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, -49, -50, 16, -52, -53, -54, -54, -55, -56, -57, 0, 38, 37, 36, 35,
+ 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19,
+ 18, 17, 16, 15, 14, 13, 12, 15, 14, 13, 12, 11, 10, 9, 8, 0};
+static uint32_t elems_phash(uint32_t i) {
+ i -= 42;
+ uint32_t x = i % 96;
+ uint32_t y = i / 96;
+ return x + (uint32_t)elems_r[y];
}
static const uint16_t elem_keys[] = {
- 138, 522, 714, 5116, 1098, 430, 5802, 232, 8840, 913, 240, 8644,
- 231, 8742, 7762, 1392, 42, 5410, 4822, 5998, 139, 1490, 5900, 7664,
- 6292, 8448, 6684, 7272, 7370, 8350, 8154, 7958, 7566, 912, 9036, 7860,
- 6488, 8546, 1111, 9134, 712, 5214, 132, 1074, 1010, 5312, 314, 242,
- 8252, 4951, 8938, 43, 7076, 6096, 6586, 6194, 1294, 1076, 5606, 1588,
- 5704, 244, 911, 5508, 6390, 7174, 6880, 1077, 713, 1009, 241, 8056,
- 1075, 6782, 7468, 4920, 243, 429, 431, 1011, 6978, 0, 0, 0,
+ 1009, 1010, 1011, 240, 241, 242, 243, 244, 138, 139, 42, 43,
+ 429, 430, 431, 911, 912, 913, 712, 713, 1098, 522, 714, 1294,
+ 1392, 1490, 1588, 4822, 4920, 4951, 5116, 5214, 5312, 1111, 5410, 5508,
+ 5606, 5704, 5802, 5900, 5998, 6096, 6194, 6292, 6390, 6488, 6586, 6684,
+ 6782, 6880, 6978, 7076, 7174, 7272, 7370, 7468, 7566, 7664, 7762, 7860,
+ 7958, 8056, 8154, 8252, 8350, 1074, 1075, 1076, 1077, 8448, 8546, 8644,
+ 8742, 8840, 8938, 9036, 9134, 314, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 132, 231, 232, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0};
+ 0};
static const uint8_t elem_idxs[] = {
- 15, 6, 2, 27, 41, 12, 34, 10, 69, 5, 19, 67, 9, 68, 58, 48, 17,
- 30, 24, 36, 16, 55, 35, 57, 39, 65, 44, 51, 52, 64, 62, 60, 54, 4,
- 72, 59, 42, 66, 7, 73, 0, 28, 8, 76, 77, 29, 14, 21, 63, 26, 71,
- 18, 49, 37, 43, 38, 70, 79, 32, 56, 33, 23, 3, 31, 40, 50, 46, 80,
- 1, 74, 20, 61, 78, 45, 53, 25, 22, 11, 13, 75, 47};
+ 74, 77, 75, 19, 20, 21, 22, 23, 15, 16, 17, 18, 11, 12, 13,
+ 3, 4, 5, 0, 1, 41, 6, 2, 70, 48, 55, 56, 24, 25, 26,
+ 27, 28, 29, 7, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 57, 58, 59,
+ 60, 61, 62, 63, 64, 76, 78, 79, 80, 65, 66, 67, 68, 69, 71,
+ 72, 73, 14, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 8, 9, 10};
grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) {
if (a == -1 || b == -1) return GRPC_MDNULL;