Ignore:
Timestamp:
May 3, 2016, 9:38:18 AM (20 months ago)
Author:
cameron
Message:

Large file fix: use boost mapped_file_source

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5012 r5021  
    327327   
    328328    mFileSize = file_size(file);
    329     mapped_file mFile;
     329    mapped_file_source mFile;
    330330    if (mFileSize == 0) {
    331331        mFileBuffer = nullptr;
     
    333333    else {
    334334        try {
    335             mFile.open(mFileName, mapped_file::priv, mFileSize, 0);
    336         } catch (std::ios_base::failure e) {
     335            mFile.open(mFileName);
     336        } catch (std::exception &e) {
    337337            std::cerr << "Error: Boost mmap of " << mFileName << ": " << e.what() << std::endl;
    338338            return;
    339339        }
    340         mFileBuffer = mFile.data();
     340        mFileBuffer = const_cast<char *>(mFile.data());
    341341    }
    342342    //std::cerr << "mFileSize =" << mFileSize << "\n";
Note: See TracChangeset for help on using the changeset viewer.