Changeset 466 in flair-src


Ignore:
Timestamp:
Mar 9, 2022, 10:29:38 AM (3 years ago)
Author:
Sanahuja Guillaume
Message:

unlock memory in simulator to avoid mmap problems when running simulator as non root

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/FrameworkManager_impl.cpp

    r424 r466  
    109109
    110110  // Avoids memory swapping for this program
     111  // GL simulator will unlock memory, otherwise it can cause problems when running simlator as non root
    111112  mlockall(MCL_CURRENT | MCL_FUTURE);
    112113
  • trunk/lib/FlairSimulator/src/Gui_impl.cpp

    r365 r466  
    2929#include <unistd.h>
    3030#include <sstream>
     31#include <sys/mman.h>
    3132
    3233using namespace irr;
     
    8485  this->scene_width = scene_width;
    8586  this->scene_height = scene_height;
     87 
     88  //unlock memory for GL simulator, otherwise it can cause problems when running simlator as non root
     89  //(mmap can fail)
     90  //memory was locked by FrameworkManager_impl constructor
     91  munlockall();
    8692
    8793  device = createDevice(driver_type, dimension2d<u32>(app_width, app_height),16, false, false, false);
Note: See TracChangeset for help on using the changeset viewer.