Lines Matching refs:hasher
39 /* False if hasher needs to be "prepared" before use. */
393 static BROTLI_INLINE void HasherInit(Hasher* hasher) {
394 hasher->common.extra = NULL;
397 static BROTLI_INLINE void DestroyHasher(MemoryManager* m, Hasher* hasher) {
398 if (hasher->common.extra == NULL) return;
399 BROTLI_FREE(m, hasher->common.extra);
402 static BROTLI_INLINE void HasherReset(Hasher* hasher) {
403 hasher->common.is_prepared_ = BROTLI_FALSE;
408 switch (params->hasher.type) {
420 static BROTLI_INLINE void HasherSetup(MemoryManager* m, Hasher* hasher,
424 if (hasher->common.extra == NULL) {
426 ChooseHasher(params, ¶ms->hasher);
428 hasher->common.extra = BROTLI_ALLOC(m, uint8_t, alloc_size);
429 if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(hasher->common.extra)) return;
430 hasher->common.params = params->hasher;
431 switch (hasher->common.params.type) {
434 InitializeH ## N(&hasher->common, \
435 &hasher->privat._H ## N, params); \
442 HasherReset(hasher);
445 if (!hasher->common.is_prepared_) {
446 switch (hasher->common.params.type) {
450 &hasher->privat._H ## N, \
458 hasher->common.dict_num_lookups = 0;
459 hasher->common.dict_num_matches = 0;
461 hasher->common.is_prepared_ = BROTLI_TRUE;
466 MemoryManager* m, Hasher* hasher, const uint8_t* data, size_t mask,
469 HasherSetup(m, hasher, params, data, position, input_size, is_last);
471 switch (hasher->common.params.type) {
475 &hasher->privat._H ## N, \