diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-12-22 11:37:01 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-12-22 11:37:01 -0800 |
commit | 1bcab1377de6afe8c0f9c895cdba04baacf3e4a5 (patch) | |
tree | 4d478ccff5da0dee3c217c01f815ee1764965501 /upb/table.h | |
parent | b5f5ee867e6c91b77490dc8894236f17a47bde00 (diff) |
Sync with internal Google development.
This breaks the open-source build, will
follow up with a change to fix it.
Diffstat (limited to 'upb/table.h')
-rw-r--r-- | upb/table.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/upb/table.h b/upb/table.h index 0786a1a..0c0a785 100644 --- a/upb/table.h +++ b/upb/table.h @@ -127,6 +127,8 @@ INLINE bool _upb_inttable_isarrkey(const upb_inttable *t, uint32_t k) { // We have the caller specify the entry_size because fixing this as a literal // (instead of reading table->entry_size) gives the compiler more ability to // optimize. +// +// Note: All returned pointers are invalidated by inserts! INLINE void *_upb_inttable_fastlookup(const upb_inttable *t, uint32_t key, size_t entry_size, size_t value_size) { upb_inttable_value *arrval = @@ -203,8 +205,11 @@ typedef struct { } upb_inttable_iter; upb_inttable_iter upb_inttable_begin(const upb_inttable *t); -upb_inttable_iter upb_inttable_next(const upb_inttable *t, upb_inttable_iter iter); -INLINE bool upb_inttable_done(upb_inttable_iter iter) { return iter.value == NULL; } +upb_inttable_iter upb_inttable_next(const upb_inttable *t, + upb_inttable_iter iter); +INLINE bool upb_inttable_done(upb_inttable_iter iter) { + return iter.value == NULL; +} INLINE uint32_t upb_inttable_iter_key(upb_inttable_iter iter) { return iter.key; } |