I posted a patch in Issue #44432. This patch is a proposed feature enhancement.
My team's application needs a way to handle memory allocation failures that occur inside apr_pool. For example in a system with tightly managed memory limits, malloc can fail. We need to detect the failure, have a chance to adjust memory limits and retry the malloc before APR continues. This patch provides a way for an application using APR to install simple function hooks within APR. It is a simpler hooks facility than the one found in apr_util mainly because it stores hooks statically. When a memory failure occurs in apr_pool, the hooks code will call the function installed by the application. This the application will have a chance to remedy the situation and retry the allocation. This hooks facility can easily be used in other places where an application might need to handle a system failure. -Vincent Finley
