I now have a plausible implementation of log4cxx using smart pointers ready
for review.  Basic overview of the changes:

* Removed all of the AddRef / ReleaseRef functions for the reference
counting of objects, since that is now handled by the smart pointer
* Added the ability to switch between classes in std and their boost
equivalents.  This is a little ugly, so it's not ideal but it does seem to
work in my testing.
* Reworked the casting to act more like C++ than Java
* Started converting some code to use atomics instead of mutexes
* Refactored some code to allow for reconfiguration in an atomic
manner(probably)
* Refactored code to not use recursive locks
* If your compiler supports C++17, this should work without any external
dependencies(apart from APR).  Other compilers will require boost.

All the tests currently pass, and the good news is that I have tested with
asan and it reports no memory leaks at this point!  The current version of
log4cxx does produce a number of memory leaks, so this is a big
improvement.  This should also fix issues with people who use asan on their
programs, so that they are not getting(probably valid) warnings about
memory access in log4cxx on their code.  Somebody was asking about this a
while ago, but now I can't remember where they were asking about it.

PR available here: https://github.com/apache/logging-log4cxx/pull/53

-Robert Middleton

Reply via email to