From 2282d2489bd8db3cd4ddbe0dd813732bffcf6452 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 12 Aug 2009 13:47:24 -0700 Subject: Refactoring: unify upb_msg. The cost is that a upb_msg will now always have an overhead of 2*sizeof(void*). This is comparable to proto2 overhead. The benefit is that upb_msg is now self-describing, and read-only algorithms can now operate on a upb_msg regardless of the memory-management scheme. Also, upb_array and upb_string now know inherently if they own their associated memory, and upb_array has a generic pointer for memory management purposes like upb_msg does. --- tests/test_table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_table.cc b/tests/test_table.cc index f61a85c..1289fbc 100644 --- a/tests/test_table.cc +++ b/tests/test_table.cc @@ -96,7 +96,7 @@ void test_inttable(int32_t *keys, size_t num_entries) upb_inttable_init(&table, num_entries, sizeof(struct inttable_entry)); for(size_t i = 0; i < num_entries; i++) { int32_t key = keys[i]; - largest_key = max(largest_key, key); + largest_key = UPB_MAX((int32_t)largest_key, key); struct inttable_entry e; e.e.key = key; e.value = key*2; -- cgit v1.2.3