summaryrefslogtreecommitdiff
path: root/src/upb.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-02-17 23:07:17 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-02-17 23:07:17 -0800
commitd8b215486245e84e33283b6047fb253bbb418e00 (patch)
tree4c07a4d3162a0390be0b55d619ddab0e7a6acb23 /src/upb.h
parentf1e1cc4695b34b292454e903adbf09e66cf2e9d5 (diff)
First version of an assembly language decoder.
It is slower than the C decoder for now because it falls off the fast path too often. But it can successfully decode varints, fixed32 and fixed64.
Diffstat (limited to 'src/upb.h')
-rw-r--r--src/upb.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/upb.h b/src/upb.h
index c5b4310..0698748 100644
--- a/src/upb.h
+++ b/src/upb.h
@@ -29,6 +29,16 @@ extern "C" {
#define UPB_MIN(x, y) ((x) < (y) ? (x) : (y))
#define UPB_INDEX(base, i, m) (void*)((char*)(base) + ((i)*(m)))
+INLINE void nop_printf(const char *fmt, ...) {
+ (void)fmt;
+}
+
+#ifdef NDEBUG
+#define DEBUGPRINTF nop_printf
+#else
+#define DEBUGPRINTF printf
+#endif
+
// Rounds val up to the next multiple of align.
INLINE size_t upb_align_up(size_t val, size_t align) {
return val % align == 0 ? val : val + align - (val % align);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback