Allow externally-managed mmaps to be used for loading data. For more info:

https://code.google.com/p/cld2/issues/detail?id=7


git-svn-id: https://cld2.googlecode.com/svn/trunk@153 b252ecd4-b096-bf77-eb8e-91563289f87e
This commit is contained in:
andrewhayden@google.com
2014-03-04 10:21:09 +00:00
parent ff57848619
commit a57e2d13c3
7 changed files with 269 additions and 109 deletions

View File

@@ -128,7 +128,7 @@ Usage:\n\
static_cast<const CLD2::ScoringTables*>(&realData),
fileName);
} else if (mode == 3) { // head
CLD2DynamicData::FileHeader* header = CLD2DynamicDataLoader::loadHeader(fileName);
CLD2DynamicData::FileHeader* header = CLD2DynamicDataLoader::loadHeaderFromFile(fileName);
if (header == NULL) {
std::cerr << "Cannot read header from file: " << fileName << std::endl;
return -1;
@@ -150,7 +150,7 @@ Usage:\n\
bool result = CLD2DynamicData::verify(
static_cast<const CLD2::ScoringTables*>(&realData),
static_cast<const CLD2::ScoringTables*>(loadedData));
CLD2DynamicDataLoader::unloadData(&loadedData, &mmapAddress, &mmapLength);
CLD2DynamicDataLoader::unloadDataFile(&loadedData, &mmapAddress, &mmapLength);
if (loadedData != NULL || mmapAddress != NULL || mmapLength != 0) {
std::cerr << "Warning: failed to clean up memory for ScoringTables." << std::endl;
}