Exemple #1
0
void
memory_set_tracker(memory_tracker_t tracker) {
	memory_tracker_t old_tracker = _memory_tracker;

	if ((old_tracker.track == tracker.track) && (old_tracker.untrack == tracker.untrack))
		return;

	_memory_tracker = _memory_no_tracker;

	if (old_tracker.finalize)
		old_tracker.finalize();

	if (tracker.initialize)
		tracker.initialize();

	_memory_tracker = tracker;
}
void memory_set_tracker( memory_tracker_t tracker )
{
	memory_tracker_t no_tracker = {0};
	memory_tracker_t old_tracker = _memory_tracker;

	if( ( old_tracker.track == tracker.track ) && ( old_tracker.untrack == tracker.untrack ) )
		return;
	
	_memory_tracker = no_tracker;
	
	if( old_tracker.shutdown )
		old_tracker.shutdown();
	
	if( tracker.initialize )
		tracker.initialize();

	_memory_tracker = tracker;
}