1 # ifndef CPPAD_UTILITY_MEMORY_LEAK_HPP
2 # define CPPAD_UTILITY_MEMORY_LEAK_HPP
152 static size_t thread_zero_static_inuse = 0;
160 "memory_leak: in_parallel() is true."
164 "memory_leak: thread_num() is not zero."
166 if( add_static != 0 )
167 { thread_zero_static_inuse += add_static;
175 if( num_bytes != thread_zero_static_inuse )
177 cout <<
"thread zero: static inuse = " << thread_zero_static_inuse;
178 cout <<
", current inuse(0)= " << num_bytes << endl;
184 cout <<
"thread zero: available = ";
185 cout << num_bytes << endl;
187 for(thread = 1; thread < CPPAD_MAX_NUM_THREADS; thread++)
193 cout <<
"thread " << thread <<
": inuse(thread) = ";
194 cout << num_bytes << endl;
200 cout <<
"thread " << thread <<
": available(thread) = ";
201 cout << num_bytes << endl;
#define CPPAD_ASSERT_KNOWN(exp, msg)
Check that exp is true, if not print msg and terminate execution.
Define processor symbols and macros that are used by CppAD.
bool memory_leak(size_t add_static=0)
Function that checks allocator thread_alloc for misuse that results in memory leaks.
static size_t available(size_t thread)
Determine the amount of memory that is currently available for use.
#define CPPAD_TRACK_COUNT()
static bool in_parallel(void)
Are we in a parallel execution state; i.e., is it possible that other threads are currently executing...
static size_t inuse(size_t thread)
Determine the amount of memory that is currently inuse.
Capacity vector for memory allocation block sizes.
static size_t thread_num(void)
Get current thread number.
File used to define the CppAD multi-threading allocator class.