Example #1
0
 public static void InitializeHC(CCtxT *hc4, byte *start)
 {
     LZ4MemoryHelper.Zero((byte *)hc4->HashTable, HashTableSizeHC * sizeof(uint));
     LZ4MemoryHelper.Fill((byte *)hc4->ChainTable, 0xFF, MaxD * sizeof(ushort));
     hc4->NextToUpdate = 64 * KB;
     hc4->BaseP        = start - 64 * KB;
     hc4->End          = start;
     hc4->DictBase     = start - 64 * KB;
     hc4->DictLimit    = 64 * KB;
     hc4->LowLimit     = 64 * KB;
 }
Example #2
0
        private static MatchT FindLongerMatch(CCtxT *ctx, byte *ip, byte *iHighLimit, int minLen, int nbSearches)
        {
            MatchT match;

            LZ4MemoryHelper.Zero((byte *)&match, sizeof(MatchT));
            byte *matchPtr    = null;
            int   matchLength = InsertAndGetWiderMatch(ctx, ip, ip, iHighLimit, minLen, &matchPtr, &ip, nbSearches, 1);

            if (matchLength <= minLen)
            {
                return(match);
            }

            match.Len = matchLength;
            match.Off = (int)(ip - matchPtr);
            return(match);
        }
Example #3
0
 public static void ResetStream(StreamT *state)
 {
     LZ4MemoryHelper.Zero((byte *)state, sizeof(StreamT));
 }