- Timestamp:
- Oct 18, 2017, 3:12:32 PM (16 months ago)
- Location:
- icGREP/icgrep-devel/icgrep
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
icGREP/icgrep-devel/icgrep/grep_engine.cpp
r5695 r5696 37 37 #include <fcntl.h> 38 38 #include <errno.h> 39 #include <llvm/ADT/STLExtras.h> // for make_unique 39 40 40 41 using namespace parabix; … … 166 167 auto f = reinterpret_cast<GrepFunctionType>(mGrepDriver->getMain()); 167 168 168 uint64_t grepResult = f(fileDescriptor, reinterpret_cast<intptr_t>(resultAccums[fileIdx] ));169 uint64_t grepResult = f(fileDescriptor, reinterpret_cast<intptr_t>(resultAccums[fileIdx].get())); 169 170 if (grepResult > 0) grepMatchFound = true; 170 171 else if ((Mode == NormalMode) && !resultAccums[fileIdx]->mResultStr.str().empty()) grepMatchFound = true; … … 218 219 } 219 220 } 220 resultAccums.push_back( new NonNormalizingReportMatch(linePrefix));221 resultAccums.push_back(make_unique<NonNormalizingReportMatch>(linePrefix)); 221 222 } 222 223 } -
icGREP/icgrep-devel/icgrep/grep_engine.h
r5695 r5696 27 27 void *DoGrepThreadFunction(void *args); 28 28 29 30 class NonNormalizingReportMatch : public MatchAccumulator { 31 public: 32 NonNormalizingReportMatch(std::string linePrefix) : mLinePrefix(linePrefix), mLineCount(0), mPrevious_line_end(nullptr) {} 33 void accumulate_match(const size_t lineNum, char * line_start, char * line_end) override; 34 void finalize_match(char * buffer_end) override; 35 std::string mLinePrefix; 36 size_t mLineCount; 37 char * mPrevious_line_end; 38 std::stringstream mResultStr; 29 39 30 31 class NonNormalizingReportMatch : public MatchAccumulator { 32 public: 33 NonNormalizingReportMatch(std::string linePrefix) : mLineCount(0), mPrevious_line_end(nullptr) {} 34 void accumulate_match(const size_t lineNum, char * line_start, char * line_end) override; 35 void finalize_match(char * buffer_end) override; 36 std::string mLinePrefix; 37 size_t mLineCount; 38 char * mPrevious_line_end; 39 std::stringstream mResultStr; 40 41 }; 42 43 44 40 }; 41 42 45 43 class GrepEngine { 46 44 public: … … 66 64 bool grepMatchFound; 67 65 68 std::vector< NonNormalizingReportMatch *> resultAccums;66 std::vector<std::unique_ptr<NonNormalizingReportMatch>> resultAccums; 69 67 std::vector<std::string> inputFiles; 70 68
Note: See TracChangeset
for help on using the changeset viewer.