Skip to content

Refactor the handling of isc_mem overmem condition

Previously, there were two methods of working with the overmem condition:

  1. hi/lo water callback - when the overmem condition was reached for the first time, the water callback was called with HIWATER mark and .is_overmem boolean was set internally. Similarly, when the used memory went below the lo water mark, the water callback would be called with LOWATER mark and .is_overmem was reset. This check would be called every time memory was allocated or freed.

  2. isc_mem_isovermem() - a simple getter for the internal .is_overmem flag

This commit refactors removes the first method and move the hi/lo water checks to the isc_mem_isovermem() function, thus we now have only a single method of checking overmem condition and the check for hi/lo water is removed from the hot path for memory contexts that doesn't use overmem checks.

Closes #4451 (closed)

Merge request reports