Boost logo

Boost :

Subject: [boost] [Test] Problems with debug::break_memory_alloc
From: Fredrik Orderud (forderud_at_[hidden])
Date: 2013-09-08 09:57:43


I have a problem with the memory-leak detection logic in boost.test. What
happens when unit_test::framework::init starts up on Windows is that
memory-leak detection is first explicitly activated. Secondly,
debug::break_memory_alloc is called with a value (default is 1). Activation
of leak detection is great, but to always override the allocation number to
break on is not necessary a good idea if the user has already set a value
from a debugger.

In my case I am investigating a leak from a static member allocated prior
to main and/or boost.test being invoked. In that case, I need to break the
program early to be able to set the allocation number to break on. This
works well by itself, but it's _very_ confusing when boost.test afterwards
replaces my allocation number with a default value.

Could it be possible to modify boost.test, so that it only modifies the
allocation number to break on if the user has explicitly requested to break
on a given allocation?

Thanks in advance,
Fredrik Orderud


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk