Proof of concept: (http://github.com/msgpack/msgpack-c)
diff --git a/example/c/user_buffer_unpack.c b/example/c/user_buffer_unpack.c index 646a9f67..041d8983 100644 --- a/example/c/user_buffer_unpack.c +++ b/example/c/user_buffer_unpack.c @@ -2,7 +2,7 @@ #include <stdio.h> #include <assert.h>
-#define UNPACKED_BUFFER_SIZE 2048 +#define UNPACKED_BUFFER_SIZE 64
void prepare(msgpack_sbuffer* sbuf) { msgpack_packer pk; @@ -12,8 +12,8 @@ void prepare(msgpack_sbuffer* sbuf) { msgpack_pack_array(&pk, 3); msgpack_pack_int(&pk, 1); msgpack_pack_true(&pk); - msgpack_pack_str(&pk, 7); - msgpack_pack_str_body(&pk, "example", 7); + msgpack_pack_str(&pk, 64); + msgpack_pack_str_body(&pk, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 64); /* 2nd object */ msgpack_pack_str(&pk, 6); msgpack_pack_str_body(&pk, "second", 6);
Proof of concept: github. com/msgpack/ msgpack- c)
(http://
diff --git a/example/ c/user_ buffer_ unpack. c b/example/ c/user_ buffer_ unpack. c c/user_ buffer_ unpack. c c/user_ buffer_ unpack. c
index 646a9f67..041d8983 100644
--- a/example/
+++ b/example/
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <assert.h>
-#define UNPACKED_ BUFFER_ SIZE 2048 BUFFER_ SIZE 64
+#define UNPACKED_
void prepare( msgpack_ sbuffer* sbuf) { msgpack_ sbuffer* sbuf) { pack_array( &pk, 3); pack_int( &pk, 1); pack_true( &pk); pack_str( &pk, 7); pack_str_ body(&pk, "example", 7); pack_str( &pk, 64); pack_str_ body(&pk, "aaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaa", 64); pack_str( &pk, 6); pack_str_ body(&pk, "second", 6);
msgpack_packer pk;
@@ -12,8 +12,8 @@ void prepare(
msgpack_
msgpack_
msgpack_
- msgpack_
- msgpack_
+ msgpack_
+ msgpack_
/* 2nd object */
msgpack_
msgpack_