summaryrefslogtreecommitdiff
path: root/descriptor/descriptor.c
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-07-11 18:53:27 -0700
committerJoshua Haberman <joshua@reverberate.org>2010-07-11 18:53:27 -0700
commit7a6a702792e769366a8852fc90dbea9cfc9e01c0 (patch)
tree3315b7ffaf527f1096aba986a73d346be00a68a1 /descriptor/descriptor.c
parentfcfc37e7d41f87bc9ff5ecfb64e0aebb3457c633 (diff)
Allow static upb_strings.
This can allow strings to reference static data, and reduced the memory footprint of test_def by about 10% (3k).
Diffstat (limited to 'descriptor/descriptor.c')
-rw-r--r--descriptor/descriptor.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/descriptor/descriptor.c b/descriptor/descriptor.c
index cd50a16..ee6b25b 100644
--- a/descriptor/descriptor.c
+++ b/descriptor/descriptor.c
@@ -1,4 +1,6 @@
-unsigned char descriptor_pb[] = {
+#include "descriptor.h"
+
+static unsigned char descriptor_pb[] = {
0x0a, 0x9b, 0x1b, 0x0a, 0x1b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x6f, 0x72, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f,
@@ -291,4 +293,5 @@ unsigned char descriptor_pb[] = {
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72,
0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01
};
-unsigned int descriptor_pb_len = 3486;
+static const unsigned int descriptor_pb_len = 3486;
+upb_string descriptor_str = UPB_STATIC_STRING(descriptor_pb);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback