Skip to content

Commit 103000a

Browse files
committed
debug
1 parent 9a2bd76 commit 103000a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

zipped_container_example.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <limits>
66
#include <sstream>
77
#include <iterator>
8+
#define DEBUG_C_PLUS_PLUS_SERIALIZER
89
#include "c_plus_plus_serializer.h"
910
#include "hexdump.h"
1011
#include "quicklz.h"
@@ -69,13 +70,13 @@ static void save_zipper_container (const std::string filename)
6970
//
7071
// Get the pre compress buffer
7172
//
72-
auto src = out.str().c_str();
73+
std::string tmp = out.str();
7374
out.seekg(0, std::ios::end);
7475
int srclen = out.tellg();
7576
out.seekg(0, std::ios::beg);
7677

7778
std::cout << "before compression ";
78-
hexdump(src, srclen);
79+
hexdump(tmp.c_str(), srclen);
7980

8081
//
8182
// Compress
@@ -90,7 +91,7 @@ static void save_zipper_container (const std::string filename)
9091
// incompressible data may increase in size.
9192
//
9293
auto dst = new char[srclen + 400 /* qlz header */];
93-
auto dstlen = qlz_compress(src, dst, srclen, state_compress);
94+
auto dstlen = qlz_compress(tmp.c_str(), dst, srclen, state_compress);
9495

9596
//
9697
// Dump the post compress buffer

0 commit comments

Comments
 (0)