diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2017-07-11 14:14:20 -0500 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2017-07-11 14:14:20 -0500 |
commit | 277c4d584f8a644c9eb8de4f8c71d823fc4a15a2 (patch) | |
tree | 0722a3abae37cb267e42f8db39424c52a2631b5f /tools/make_c_api.lua | |
parent | 2e01793dede6b3de34370c5f813fb82b2eebb461 (diff) | |
parent | 1278ff899409025692d6915421f1af1c99dc837e (diff) |
Merge branch 'gencode2' into gencode3
Diffstat (limited to 'tools/make_c_api.lua')
-rw-r--r-- | tools/make_c_api.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/make_c_api.lua b/tools/make_c_api.lua index 62fd370..9e6d734 100644 --- a/tools/make_c_api.lua +++ b/tools/make_c_api.lua @@ -30,11 +30,6 @@ function strip_proto(filename) return string.gsub(filename, '%.proto$','') end ---[[ - [upb.TYPE_ENUM] = 5, - [upb.TYPE_MESSAGE] = 8, ---]] - local function join(...) return table.concat({...}, ".") end @@ -154,6 +149,12 @@ local function field_layout_rank(field) -- 4. string fields -- 5. submessage fields -- 6. repeated fields + -- + -- This has the following nice properties: + -- + -- 1. padding alignment is (nearly) minimized. + -- 2. fields that might have defaults (1-4) are segregated + -- from fields that are always zero-initialized (5-7). local rank if field:containing_oneof() then rank = 100 -- These go last (actually we skip them). |