Changeset 4250:fc5fb0a8b48d in roaraudio


Ignore:
Timestamp:
08/25/10 16:08:00 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

implemented MEMLOCK_ALL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/memlock.c

    r4247 r4250  
    111111 } 
    112112 
     113 // TODO: fix those #ifdefs and replace them with more general tests 
     114 if ( level == MEMLOCK_ALL ) { 
     115#ifdef ROAR_HAVE_MLOCKALL 
     116  // if we do not have ROAR_HAVE_MLOCKALL we do not have MCL_* flags. 
     117  // we just try to lock all known segments as fallback. 
     118  return roar_mm_mlockall(MCL_CURRENT|MCL_FUTURE); 
     119#endif 
     120 } else if ( old_level == MEMLOCK_ALL ) { 
     121#ifdef ROAR_HAVE_MUNLOCKALL 
     122  ret = roar_mm_munlockall(); 
     123  // after roar_mm_munlockall() we need to re-lock all segemnts of target locking level. 
     124  i = old_level; 
     125  old_level = MEMLOCK_NONE; 
     126  return memlock_set_level(i); 
     127#endif 
     128 } 
     129 
    113130 for (i = 0; i < MAX_SEGMENTS; i++) { 
    114131  if ( memlock_table[i].addr != NULL ) { 
Note: See TracChangeset for help on using the changeset viewer.