CyberDem0n / bg_mon

Background worker for monitoring PostgreSQL
MIT License
66 stars 11 forks source link

Special memory handling in the libevent thread #22

Closed CyberDem0n closed 5 years ago

CyberDem0n commented 5 years ago

From the main thread, we are using the usual memory contexts, which will exit the process if memory allocation/reallocation fails, while from the API thread we were mostly ignoring errors. This commit fixes it by setting custom memory management functions for libevent. These functions are simple wrappers over realloc() and will exit background worker on failure.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-1.01%) to 87.68% when pulling b15b0dc5972a199c900e7cbb3cf2b2ac806bdb00 on feature/safety into 011f6ab55793a06f3df13a2bcc4f5be7c1948d2e on master.