Changeset 699:0cbad3ff56d5 in roaraudio


Ignore:
Timestamp:
08/28/08 05:12:27 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added a inline ROAR_MLOCK() if not linux but inline funcs supportet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/roaraudio.h

    r515 r699  
    112112#else 
    113113#undef ROAR_HAVE_MLOCK 
     114#ifdef ROAR_HAVE_INLINE 
     115inline int ROAR_MLOCK(const void *addr, size_t len) { 
     116 long sz = sysconf(_SC_PAGESIZE); 
     117 unsigned long int pos = (unsigned long int) addr; 
     118 
     119 len += sz - (len % sz); 
     120 
     121 pos -= pos % sz; 
     122 
     123 return mlock((void*)pos, len); 
     124} 
     125#define ROAR_MLOCK ROAR_MLOCK 
     126#else 
    114127#define ROAR_MLOCK(p,s) 
    115128#warning No working mlock() support for this platform 
     129#endif 
    116130#endif 
    117131#endif 
Note: See TracChangeset for help on using the changeset viewer.