static void LZ4_renormDictT()

in Sources/aliyun-log-c-sdk/log_lz4.c [990:1008]


static void LZ4_renormDictT(LZ4_stream_t_internal* LZ4_dict, const BYTE* src)
{
    if ((LZ4_dict->currentOffset > 0x80000000) ||
        ((size_t)LZ4_dict->currentOffset > (size_t)src))   /* address space overflow */
    {
        /* rescale hash table */
        U32 delta = LZ4_dict->currentOffset - 64 LOG_KB;
        const BYTE* dictEnd = LZ4_dict->dictionary + LZ4_dict->dictSize;
        int i;
        for (i=0; i<LOG_HASH_SIZE_U32; i++)
        {
            if (LZ4_dict->hashTable[i] < delta) LZ4_dict->hashTable[i]=0;
            else LZ4_dict->hashTable[i] -= delta;
        }
        LZ4_dict->currentOffset = 64 LOG_KB;
        if (LZ4_dict->dictSize > 64 LOG_KB) LZ4_dict->dictSize = 64 LOG_KB;
        LZ4_dict->dictionary = dictEnd - LZ4_dict->dictSize;
    }
}