Eliminate the mlock logic entirely. It's caused a couple of issues lately and it turns out it wasn't even used!

This commit is contained in:
Chris Cannam
2022-09-26 10:11:16 +01:00
parent 0eaca1711c
commit 57d59b4c7a
2 changed files with 1 additions and 32 deletions

View File

@@ -108,10 +108,6 @@ void gettimeofday(struct timeval *p, void *tz);
#ifdef _WIN32
#define MLOCK(a,b) (void)1
#define MUNLOCK(a,b) (void)1
#define MUNLOCK_SAMPLEBLOCK(a) (void)1
namespace RubberBand {
extern void system_memorybarrier();
}
@@ -119,14 +115,8 @@ extern void system_memorybarrier();
#else // !_WIN32
#include <sys/mman.h>
#include <dlfcn.h>
#include <stdio.h>
#define MLOCK(a,b) mlock((char *)(a),(b))
#define MUNLOCK(a,b) (munlock((char *)(a),(b)) ? (perror("munlock failed"), 0) : 0)
#define MUNLOCK_SAMPLEBLOCK(a) do { if (!(a).empty()) { const float &b = *(a).begin(); MUNLOCK(&b, (a).capacity() * sizeof(float)); } } while(0);
#ifdef __APPLE__
# if defined __MAC_10_12
# define MBARRIER() __sync_synchronize()