summaryrefslogtreecommitdiff
path: root/upb/table.c
AgeCommit message (Collapse)Author
2019-03-27Moved macros from upb.h to port_def.inc to avoid leaking them to users. (#160)Joshua Haberman
* Use port_def.inc to prevent macros from leaking to users. * Added helpful comments to port_def.inc/port_undef.inc.
2019-03-14Merge pull request #151 from linux-on-ibm-z/masterJoshua Haberman
Adding support for big endian platform (s390x)
2019-02-02Update table.cShahid
2019-01-26Fixed tests and code.Josh Haberman
2018-08-27Bugfix on bigendianess by casting size_t to unint32_tSakala Venkata Krishna Rohit
The reason for typecasting size_t to unint32_t is that size_t is 8 bytes and uint32_t is only 4 bytes. If not typecasted Memcpy fails to copy the *correct* four bytes in big endian platforms.
2016-09-01A small bugfix to upb_table and simplified some code.Josh Haberman
2016-05-12Added UPB_ASSERT() that helps avoid unused var warnings.Joshua Haberman
* Added UPB_ASSERT() that helps avoid unused var warnings. * Addressed PR comments. * Fixed assert in the JIT.
2016-04-19Split upb::Arena/upb::Allocator from upb::Environment. (#58)Joshua Haberman
* Split upb::Arena/upb::Allocator from upb::Environment. This will allow arenas and allocators to be used independently of environments, which will be important for an upcoming change (a message representation). Overall this design feels cleaner that the previous Environment/SeededAllocator design. As part of this change, moved all allocations in upb to use a global allocator instead of hard-coding malloc/free. This will allow injecting OOM faults for more robust testing. One place that doesn't use the global allocator is the tracked ref code. Instead of its previous approach of CHECK_OOM() after every malloc() or table insert, it simply uses an allocator that does this automatically. I moved Allocator/Arena/Environment into upb.h. This seems principled since these are the only types in upb whose size is directly exposed to users, since they form the basis of memory allocation strategy. * Cleaned up some header includes and fixed more malloc -> upb_gmalloc(). * Changes from PR review. * Don't use UINTPTR_MAX or UINT64_MAX. * Punt on adding line/file for now. * We actually can't store (uint64_t)-1, update comment and test.
2016-01-26Added small explanatory comment.Josh Haberman
2016-01-19Optimized upb_inttable_compact(): it shrinks inttables more now.Josh Haberman
2015-07-07Brought into compliance with Google open-source policies.Josh Haberman
- removed myself from Author headers in source files. - removed copyright notices from source file headers. - added CONTRIBUTING.md
2015-06-04Fixes from Google-internal.Josh Haberman
2015-06-02Ported upb to C89, for greater portability.Josh Haberman
A large part of this change contains surface-level porting, like moving variable declarations to the top of the block. However there are a few more substantial things too: - moved internal-only struct definitions to a separate file (structdefs.int.h), for greater encapsulation and ABI compatibility. - removed the UPB_UPCAST macro, since it requires access to the internal-only struct definitions. Replaced uses with calls to inline, type-safe casting functions. - removed the UPB_DEFINE_CLASS/UPB_DEFINE_STRUCT macros. Class and struct definitions are now more explicit -- you get to see the actual class/struct keywords in the source. The casting convenience functions have been moved into UPB_DECLARE_DERIVED_TYPE() and UPB_DECLARE_DERIVED_TYPE2(). - the new way that we duplicate base methods in derived types is also more convenient and requires less duplication. It is also less greppable, but hopefully that is not too big a problem. Compiler flags (-std=c89 -pedantic) should help to rigorously enforce that the code is free of C99-isms. A few functions are not available in C89 (strtoll). There are temporary, hacky solutions in place.
2015-05-17Restructure tables for C89 port and smaller size.Josh Haberman
Changes the data layout of tables slightly so that string keys are prefixed with their size, rather than the size being inline in the table itself. This has a few benefits: 1. inttables shrink a bit, because there is no longer a wasted and unused size field sitting in them. 2. This avoids the need to have a union in the table. This is important for an impending C89 port of upb, since C89 has literally no way of statically initializing a non-first union member.
2015-05-06Resolve compilation errors if compiled with more stringent semantic checks.Martin Maly
Adding Travis test to build with strict warnings. Fixing a warning in a test which used signed/unsigned integer comparison.
2015-02-02Support maps in JSON parsing and serialization.Chris Fallin
This is a sync of our internal developing of JSON parsing and serialization. It implements native understanding of MapEntry submessages, so that map fields with (key, value) pairs are serialized as JSON maps (objects) natively rather than as arrays of objects with 'key' and 'value' fields. The parser also now understands how to emit handler calls corresponding to MapEntry objects when processing a map field. This sync also picks up a bugfix in `table.c` to handle an alloc-failed case.
2014-12-18Modified strtable to support length-delimited string keys. Allows forChris Fallin
arbitrary binary data, e.g., to support strings from other languages as key values.
2014-11-18Sync to Google-internal development.Josh Haberman
2014-08-09Make the absence of perf-cppflags give a good default build.Josh Haberman
Defaults are now: - thread-safe with GCC/Clang - Debugging not enabled (enable with -UNDEBUG)
2014-07-24Sync from Google-internal development.Josh Haberman
2014-06-26Sync from internal Google development.Josh Haberman
2013-10-24Merge from Google-internal development:Josh Haberman
- rewritten decoder; interpreted decoder is bytecode-based, JIT decoder no longer falls back to the interpreter. - C++ improvements: C++11-compatible iterators, upb::reffed_ptr for RAII refcounting, better upcast/downcast support. - removed the gross upb_value abstraction from public upb.h.
2013-05-11Open source fixes: builds on OS X again.Joshua Haberman
2013-05-11Synced with 3 months of Google-internal development.Josh Haberman
Major changes: - Got rid of all bytestream interfaces in favor of using regular handlers. - new Pipeline object represents a upb pipeline, does bump allocation internally to manage memory. - proto2 support now can handle extensions.
2013-02-15Sync with 8 months of Google-internal development.Josh Haberman
Many things have changed and been simplified. The memory-management story for upb_def and upb_handlers is much more robust; upb_def and upb_handlers should be fairly stable interfaces now. There is still much work to do for the runtime component (upb_sink).
2012-03-31Sync from internal Google development.Joshua Haberman
2012-03-24Sync from internal Google development.Joshua Haberman
Many improvements, too many to mention. One significant perf regression warrants investigation: omitfp.parsetoproto2_googlemessage1.upb_jit: 343 -> 252 (-26.53) plain.parsetoproto2_googlemessage1.upb_jit: 334 -> 251 (-24.85) 25% regression for this benchmark is bad, but since I don't think there's any fundamental design issue that caused it I'm going to go ahead with the commit anyway. Can investigate and fix later. Other benchmarks were neutral or showed slight improvement.
2011-09-20Fixes to get upb to compile inside Google.Joshua Haberman
2011-09-04Const invasion: large parts of upb made const-correct.Joshua Haberman
2011-07-15Directory restructure.Joshua Haberman
Includes are now via upb/foo.h. Files specific to the protobuf format are now in upb/pb (the core library is concerned with message definitions, handlers, and byte streams, but knows nothing about any particular serializationf format).
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback