本文整理汇总了C++中TraceData::fixPool方法的典型用法代码示例。如果您正苦于以下问题:C++ TraceData::fixPool方法的具体用法?C++ TraceData::fixPool怎么用?C++ TraceData::fixPool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TraceData
的用法示例。
在下文中一共展示了TraceData::fixPool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadInternal
/**
* The main import function...
*/
int CachegrindLoader::loadInternal(TraceData* data,
QIODevice* device, const QString& filename)
{
if (!data || !device) return 0;
_data = data;
_filename = filename;
_lineNo = 0;
loadStart(_filename);
FixFile file(device, _filename);
if (!file.exists()) {
loadFinished(QStringLiteral("File does not exist"));
return 0;
}
int statusProgress = 0;
#if USE_FIXCOST
// FixCost Memory Pool
FixPool* pool = _data->fixPool();
#endif
_part = 0;
partsAdded = 0;
prepareNewPart();
FixString line;
char c;
// current position
nextLineType = SelfCost;
// default if there is no "positions:" line
hasLineInfo = true;
hasAddrInfo = false;
while (file.nextLine(line)) {
_lineNo++;
#if TRACE_LOADER
qDebug() << "[CachegrindLoader] " << _filename << ":" << _lineNo
<< " - '" << QString(line) << "'";
#endif
// if we cannot strip a character, this was an empty line
if (!line.first(c)) continue;
if (c <= '9') {
if (c == '#') continue;
// parse position(s)
if (!parsePosition(line, currentPos)) {
error(QStringLiteral("Invalid position specification '%1'").arg(line));
continue;
}
// go through after big switch
}
else { // if (c > '9')
line.stripFirst(c);
/* in order of probability */
switch(c) {
case 'f':
// fl=
if (line.stripPrefix("l=")) {
setFile(line);
// this is the default for new functions
currentFunctionFile = currentFile;
continue;
}
// fi=, fe=
if (line.stripPrefix("i=") ||
line.stripPrefix("e=")) {
setFile(line);
continue;
}
// fn=
if (line.stripPrefix("n=")) {
if (currentFile != currentFunctionFile)
currentFile = currentFunctionFile;
setFunction(line);
// on a new function, update status
int progress = (int)(100.0 * file.current() / file.len() +.5);
if (progress != statusProgress) {
//.........这里部分代码省略.........