pool/test/test_valgrind_fail_2.cpp
John Maddock c7b0d00943 Add some debugging code.
Add tentative Valgrind support.
Change singleton usage to address issue 5526 by making singletons eternal.
Add Valgrind tests.
Update docs to match.
Refs #5526.

[SVN r73121]
2011-07-15 17:40:49 +00:00

21 lines
498 B
C++

/* Copyright (C) 2011 John Maddock
*
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
*/
// Test of bug #2656 (https://svn.boost.org/trac/boost/ticket/2656)
#include <boost/pool/pool.hpp>
int main()
{
boost::pool<> p(sizeof(int));
int* ptr = static_cast<int*>((p.malloc)());
*ptr = 0;
(p.free)(ptr);
*ptr = 2; // write to freed memory
return 0;
}