Changeset 4251:abe188f70256 in roaraudio for roard/memlock.c
- Timestamp:
- 08/25/10 16:18:35 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/memlock.c
r4250 r4251 47 47 48 48 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)); 49 55 } 50 56 … … 85 91 } else if ( !strcasecmp(str, "medium") ) { 86 92 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; 87 101 } else if ( !strcasecmp(str, "all") ) { 88 102 return MEMLOCK_ALL; … … 116 130 // if we do not have ROAR_HAVE_MLOCKALL we do not have MCL_* flags. 117 131 // we just try to lock all known segments as fallback. 132 old_level = MEMLOCK_ALL; 118 133 return roar_mm_mlockall(MCL_CURRENT|MCL_FUTURE); 119 134 #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 ) { 121 141 #ifdef ROAR_HAVE_MUNLOCKALL 122 142 ret = roar_mm_munlockall();
Note: See TracChangeset
for help on using the changeset viewer.