diff options
Diffstat (limited to 'upb_table.c')
-rw-r--r-- | upb_table.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/upb_table.c b/upb_table.c index 03fab2f..3bbc7f7 100644 --- a/upb_table.c +++ b/upb_table.c @@ -30,6 +30,7 @@ void upb_table_init(struct upb_table *t, uint32_t size, uint16_t entry_size) t->size_lg2 = 1; while(size >>= 1) t->size_lg2++; size_t bytes = upb_table_size(t) * t->entry_size; + t->mask = upb_table_size(t) - 1; t->entries = malloc(bytes); memset(t->entries, 0, bytes); /* Both tables consider 0's an empty entry. */ } |