Merge pull request #332 from haberman/php-amalgamation

Amalgamation no longer bundles wyhash, but #includes it.
pull/13171/head
Joshua Haberman 4 years ago committed by GitHub
commit 7543f851f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      BUILD
  2. 2
      benchmarks/benchmark.cc
  3. 2
      tests/bindings/lua/test_upb.lua
  4. 2
      tools/amalgamate.py
  5. 2
      upb/json_encode.h
  6. 2
      upb/table.int.h

16
BUILD

@ -289,7 +289,10 @@ upb_amalgamation(
cc_library(
name = "amalgamation",
srcs = ["upb.c"],
srcs = [
"upb.c",
"third_party/wyhash/wyhash.h",
],
hdrs = ["upb.h"],
copts = UPB_DEFAULT_COPTS,
)
@ -314,9 +317,13 @@ upb_amalgamation(
cc_library(
name = "php_amalgamation",
srcs = ["php-upb.c"],
srcs = [
"php-upb.c",
"third_party/wyhash/wyhash.h",
],
hdrs = ["php-upb.h"],
copts = UPB_DEFAULT_COPTS,
)
upb_amalgamation(
@ -338,7 +345,10 @@ upb_amalgamation(
cc_library(
name = "ruby_amalgamation",
srcs = ["ruby-upb.c"],
srcs = [
"ruby-upb.c",
"third_party/wyhash/wyhash.h",
],
hdrs = ["ruby-upb.h"],
copts = UPB_DEFAULT_COPTS,
)

@ -56,7 +56,7 @@ static void BM_LoadDescriptor_Upb(benchmark::State& state) {
google_protobuf_DescriptorProto_getmsgdef(symtab.ptr());
bytes_per_iter = _upb_symtab_bytesloaded(symtab.ptr());
}
state.SetBytesProcessed(state.iterations() * descriptor.size);
state.SetBytesProcessed(state.iterations() * bytes_per_iter);
}
BENCHMARK(BM_LoadDescriptor_Upb);

@ -104,7 +104,7 @@ function test_utf8()
upb.decode(test_messages_proto3.TestAllTypesProto3, serialized)
end)
-- TOOD(haberman): should proto3 accessors also check UTF-8 at set time?
-- TODO(haberman): should proto3 accessors also check UTF-8 at set time?
end
function test_string_double_map()

@ -52,7 +52,7 @@ class Amalgamator:
include = parse_include(line)
if not include:
return False
if not (include.startswith("upb") or include.startswith("google") or include.startswith("third_party")):
if not (include.startswith("upb") or include.startswith("google")):
return False
if include.endswith("hpp"):
# Skip, we don't support the amalgamation from C++.

@ -9,7 +9,7 @@ extern "C" {
#endif
enum {
/* When set, emits 0/default values. TOOD(haberman): proto3 only? */
/* When set, emits 0/default values. TODO(haberman): proto3 only? */
UPB_JSONENC_EMITDEFAULTS = 1,
/* When set, use normal (snake_caes) field names instead of JSON (camelCase)

@ -13,7 +13,7 @@
** store pointers or integers of at least 32 bits (upb isn't really useful on
** systems where sizeof(void*) < 4).
**
** The table must be homogenous (all values of the same type). In debug
** The table must be homogeneous (all values of the same type). In debug
** mode, we check this on insert and lookup.
*/

Loading…
Cancel
Save