Changeset 4251:abe188f70256 in roaraudio for roard/memlock.c


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

added more levels, added more segments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/memlock.c

    r4250 r4251  
    4747 
    4848 memlock_register(MEMLOCK_MEDIUM, memlock_table, sizeof(memlock_table)); 
     49 
     50 memlock_register(MEMLOCK_MEDIUM, g_clients, sizeof(g_clients)); 
     51 memlock_register(MEMLOCK_MEDIUM, g_streams, sizeof(g_streams)); 
     52 
     53 memlock_register(MEMLOCK_HIGH, g_listen, sizeof(g_listen)); 
     54 memlock_register(MEMLOCK_HIGH, &g_counters, sizeof(g_counters)); 
    4955} 
    5056 
     
    8591 } else if ( !strcasecmp(str, "medium") ) { 
    8692  return MEMLOCK_MEDIUM; 
     93 } else if ( !strcasecmp(str, "high") ) { 
     94  return MEMLOCK_HIGH; 
     95 } else if ( !strcasecmp(str, "nearlyall") ) { 
     96  return MEMLOCK_NEARLYALL; 
     97 } else if ( !strcasecmp(str, "nearlyallsys") ) { 
     98  return MEMLOCK_NEARLYALLSYS; 
     99 } else if ( !strcasecmp(str, "allcur") ) { 
     100  return MEMLOCK_ALLCUR; 
    87101 } else if ( !strcasecmp(str, "all") ) { 
    88102  return MEMLOCK_ALL; 
     
    116130  // if we do not have ROAR_HAVE_MLOCKALL we do not have MCL_* flags. 
    117131  // we just try to lock all known segments as fallback. 
     132  old_level = MEMLOCK_ALL; 
    118133  return roar_mm_mlockall(MCL_CURRENT|MCL_FUTURE); 
    119134#endif 
    120  } else if ( old_level == MEMLOCK_ALL ) { 
     135 } else if ( level == MEMLOCK_ALLCUR ) { 
     136#ifdef ROAR_HAVE_MLOCKALL 
     137  old_level = MEMLOCK_ALLCUR; 
     138  return roar_mm_mlockall(MCL_CURRENT); 
     139#endif 
     140 } else if ( old_level == MEMLOCK_ALL || old_level == MEMLOCK_ALLCUR ) { 
    121141#ifdef ROAR_HAVE_MUNLOCKALL 
    122142  ret = roar_mm_munlockall(); 
Note: See TracChangeset for help on using the changeset viewer.