Skip to content

Commit

Permalink
Merge pull request EOSIO#13 from EOSIO/mlock
Browse files Browse the repository at this point in the history
wrap mlock with ifndef _WIN32 EOSIO#3891
  • Loading branch information
moskvanaft authored Jun 7, 2018
2 parents 8fef036 + f4257f5 commit 2353658
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/chainbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ namespace chainbase {
0, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
) );
_segment->find_or_construct< environment_check >( "environment" )();

#ifndef _WIN32
int r = mlock( _segment->get_address(), _segment->get_size() );
if (r != 0 ) {
//we cannot use fc library here, which means that this message doesn't go to graylog even if you have configure it
Expand All @@ -86,6 +88,7 @@ namespace chainbase {
std::cerr << "CHAINBASE: Failed to lock chainbase in RAM: " << std::strerror(errno) << std::endl
<< "CHAINBASE: Performance degradation is possible" << std::endl;
}
#endif
}


Expand Down

0 comments on commit 2353658

Please sign in to comment.