@sergey-safarov the build fix can be found in this commit - https://github.com/ivanuschak/kamailio/commit/aad84394db96756e5cdc423d64bc38...
But that is just a temporary fix to make build with TLS_MALLOC_DBG flag successful for centos 8, but that is not something can be posted for review and further merge, becasue the implementation needs to be more correct.