src/trie/Provider.cpp
int64_t Provider::initWithValidate(
	const string &fileName,
	const string &propertyString) {
	int64_t predictedSize;

	// Reset the actual size parameter as it is global and may have been set
	// before.
	_actualSize = 0;

	// Use the getProviderSize function to get the predicted size that the
	// provider will need.
	predictedSize = (int64_t)fiftyoneDegreesGetProviderSizeWithPropertyString(
		fileName.c_str(),
		propertyString.c_str());

	// Set the malloc function to use the function that increments _actualSize
	// by the amount being allocated.
	fiftyoneDegreesMalloc = validateMalloc;

	// Use the standard init function to initialise the provider. This is the
	// same function used by the standard constructor, however every memory
	// allocation will be counted using the validateMalloc function.
	init(fileName, propertyString);

	// Revert the malloc function so that future calls do not use the 
	// validateMalloc function.
	fiftyoneDegreesMalloc = malloc;

	// Return the difference between the predicted and actual sizes. A positive
	// number is an overestimate, and a negative number is an underestimate.
	return predictedSize - _actualSize;
}
/**
* Modified provider init function. This uses the standard init function,
* but uses a modified malloc function to determine the size. It also uses
* the getProviderSize function to get the estimated size and return the
* difference.
*
* This function is NOT THREAD SAFE so should be used appropriately.
* @param fileName of the data source
* @param propertyString contains comma seperated property names to be available
* to query from associated match results.
*/
Modified provider init function. This uses the standard init function,
but uses a modified malloc function to determine the size. It also uses
the getProviderSize function to get the estimated size and return the
difference.

This function is NOT THREAD SAFE so should be used appropriately.
Modified provider init function . This uses the standard init function but uses a modified malloc function to determine the size . It also uses the getProviderSize function to get the estimated size and return the difference . This function is NOT THREAD SAFE so should be used appropriately .
int64_t Provider::initWithValidate(
	const string &fileName,
	const string &propertyString) {
	int64_t predictedSize;
	_actualSize = 0;
	predictedSize = (int64_t)fiftyoneDegreesGetProviderSizeWithPropertyString(
		fileName.c_str(),
		propertyString.c_str());
	fiftyoneDegreesMalloc = validateMalloc;
	init(fileName, propertyString);
	fiftyoneDegreesMalloc = malloc;
	return predictedSize - _actualSize;
}
int64_t Provider :: initWithValidate ( const string & fileName , const string & propertyString ) { int64_t predictedSize ; _actualSize = 0 ; predictedSize = ( int64_t ) fiftyoneDegreesGetProviderSizeWithPropertyString ( fileName . c_str ( ) , propertyString . c_str ( ) ) ; fiftyoneDegreesMalloc = validateMalloc ; init ( fileName , propertyString ) ; fiftyoneDegreesMalloc = malloc ; return predictedSize - _actualSize ; }
Modified provider init function.
Modified provider init function .
// Reset the actual size parameter as it is global and may have been set // before. // Use the getProviderSize function to get the predicted size that the // provider will need. // Set the malloc function to use the function that increments _actualSize // by the amount being allocated. // Use the standard init function to initialise the provider. This is the // same function used by the standard constructor, however every memory // allocation will be counted using the validateMalloc function. // Revert the malloc function so that future calls do not use the  // validateMalloc function. // Return the difference between the predicted and actual sizes. A positive // number is an overestimate, and a negative number is an underestimate.