Fix the isc_hp initialization and memory usage

Merged Ondřej Surý requested to merge 3048-fix-isc_hp-initialization into main

Previously, the isc_hp_init() could not lower the value of isc__hp_max_threads, but because of a mistake the isc__hp_max_threads would be set to HP_MAX_THREADS (e.g. 128 threads) thus it would be always set to 128. This would result in increased memory usage even when small number of workers were in use.

Change the default value of isc__hp_max_threads to be -1 (uninitialized) and require the isc_hp_init() to be called and called only once.

Additionally, enforce the max_hps value in isc_hp_new() to be smaller or equal to HP_MAX_HPS. The only user is isc_queue which uses just 1 hazard pointer, so it's only theoretical issue.

Closes #3048 (closed)

Edited by Ondřej Surý

Merge request reports