diff options
author | test4973 <Kdo4973@hotmail.com> | 2018-04-12 14:25:40 (GMT) |
---|---|---|
committer | test4973 <Kdo4973@hotmail.com> | 2018-04-12 20:35:19 (GMT) |
commit | 8af32ce6f7109ecf5cd7d73527e0aba3a63b55e5 (patch) | |
tree | d55f2c85ea5ebf574ec894081c668636dea650a9 /lib | |
parent | 1838803948ceaf211b9e79fb405ef9b7340762ce (diff) | |
download | lz4-8af32ce6f7109ecf5cd7d73527e0aba3a63b55e5.zip lz4-8af32ce6f7109ecf5cd7d73527e0aba3a63b55e5.tar.gz lz4-8af32ce6f7109ecf5cd7d73527e0aba3a63b55e5.tar.bz2 |
modified a few traces for debug
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4.c | 5 | ||||
-rw-r--r-- | lib/lz4hc.c | 7 |
2 files changed, 6 insertions, 6 deletions
@@ -594,7 +594,6 @@ LZ4_FORCE_INLINE void LZ4_prepareTable( cctx->tableType = clearedTable; } else { DEBUGLOG(4, "Re-use hash table (no reset)"); - //if (tableType == byU32) cctx->currentOffset += 64 KB; } } @@ -602,9 +601,11 @@ LZ4_FORCE_INLINE void LZ4_prepareTable( * than compressing without a gap. However, compressing with * currentOffset == 0 is faster still, so we preserve that case. */ + DEBUGLOG(2, "tableType=%u, currentOffset=%u", cctx->tableType, cctx->currentOffset); if (cctx->currentOffset != 0 && tableType == byU32) { cctx->currentOffset += 64 KB; } + DEBUGLOG(2, "currentOffset: %u", cctx->currentOffset); /* Finally, clear history */ cctx->dictCtx = NULL; @@ -1267,7 +1268,7 @@ int LZ4_loadDict (LZ4_stream_t* LZ4_dict, const char* dictionary, int dictSize) const BYTE* const dictEnd = p + dictSize; const BYTE* base; - DEBUGLOG(4, "LZ4_loadDict %p", LZ4_dict); + DEBUGLOG(4, "LZ4_loadDict (%p into %p)", dictionary, LZ4_dict); LZ4_prepareTable(dict, 0, tableType); diff --git a/lib/lz4hc.c b/lib/lz4hc.c index d05760b..111a09b 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -336,7 +336,7 @@ LZ4_FORCE_INLINE int LZ4HC_encodeSequence ( U32 const mlAdd = (matchLength>=19) ? ((matchLength-19) / 255) + 1 : 0; U32 const cost = 1 + llAdd + ll + 2 + mlAdd; if (start==NULL) start = *anchor; /* only works for single segment */ - //g_debuglog_enable = (pos >= 2228) & (pos <= 2262); + /* g_debuglog_enable = (pos >= 2228) & (pos <= 2262); */ DEBUGLOG(6, "pos:%7u -- literals:%3u, match:%4i, offset:%5u, cost:%3u + %u", pos, (U32)(*ip - *anchor), matchLength, (U32)(*ip-match), @@ -1137,15 +1137,14 @@ static int LZ4HC_compress_optimal ( encode: /* cur, last_match_pos, best_mlen, best_off must be set */ assert(cur < LZ4_OPT_NUM); assert(last_match_pos >= 1); /* == 1 when only one candidate */ - DEBUGLOG(6, "reverse traversal, looking for shortest path") - DEBUGLOG(6, "last_match_pos = %i", last_match_pos); + DEBUGLOG(6, "reverse traversal, looking for shortest path (last_match_pos=%i)", last_match_pos); { int candidate_pos = cur; int selected_matchLength = best_mlen; int selected_offset = best_off; while (1) { /* from end to beginning */ int const next_matchLength = opt[candidate_pos].mlen; /* can be 1, means literal */ int const next_offset = opt[candidate_pos].off; - DEBUGLOG(6, "pos %i: sequence length %i", candidate_pos, selected_matchLength); + DEBUGLOG(7, "pos %i: sequence length %i", candidate_pos, selected_matchLength); opt[candidate_pos].mlen = selected_matchLength; opt[candidate_pos].off = selected_offset; selected_matchLength = next_matchLength; |