mirror of
				https://github.com/msgpack/msgpack-c.git
				synced 2025-10-25 10:09:38 +02:00 
			
		
		
		
	 12b5a6235a
			
		
	
	12b5a6235a
	
	
	
		
			
			Set /WX flas that is warnings as errors on MSVC build. Updated linux, osx, msvc build to refer to appropriate boost libraries.
		
			
				
	
	
		
			37 lines
		
	
	
		
			660 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			660 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #include <msgpack.h>
 | |
| 
 | |
| void test()
 | |
| {
 | |
|     size_t size = 10000000;
 | |
|     msgpack_sbuffer buf;
 | |
|     msgpack_packer * pk;
 | |
|     size_t upk_pos = 0;
 | |
|     msgpack_unpacked msg;
 | |
| 
 | |
|     msgpack_sbuffer_init(&buf);
 | |
| 
 | |
|     pk = msgpack_packer_new(&buf, msgpack_sbuffer_write);
 | |
| 
 | |
|     msgpack_pack_array(pk, size);
 | |
|     {
 | |
|         size_t idx = 0;
 | |
|         for (; idx < size; ++idx)
 | |
|             msgpack_pack_uint32(pk, 1);
 | |
|     }
 | |
|     msgpack_packer_free(pk);
 | |
| 
 | |
|     msgpack_unpacked_init(&msg);
 | |
| 
 | |
|     while (msgpack_unpack_next(&msg, buf.data, buf.size, &upk_pos)) {
 | |
|     }
 | |
| 
 | |
|     msgpack_sbuffer_destroy(&buf);
 | |
| }
 | |
| 
 | |
| int main(void)
 | |
| {
 | |
|     int i = 0;
 | |
|     for (; i < 10; ++i) test();
 | |
|     return 0;
 | |
| }
 |