From 1bcab1377de6afe8c0f9c895cdba04baacf3e4a5 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 22 Dec 2011 11:37:01 -0800 Subject: Sync with internal Google development. This breaks the open-source build, will follow up with a change to fix it. --- upb/table.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'upb/table.h') 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; } -- cgit v1.2.3