|
|
@@ -1,20 +1,20 @@ |
|
|
|
/* |
|
|
|
Copyright (C) 2004-2008 Grame |
|
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
|
|
|
it under the terms of the GNU Lesser General Public License as published by |
|
|
|
the Free Software Foundation; either version 2.1 of the License, or |
|
|
|
(at your option) any later version. |
|
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
GNU Lesser General Public License for more details. |
|
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License |
|
|
|
along with this program; if not, write to the Free Software |
|
|
|
along with this program; if not, write to the Free Software |
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
#include "JackError.h" |
|
|
@@ -33,7 +33,7 @@ JackShmMem::JackShmMem() |
|
|
|
JackShmMemAble::Init(); |
|
|
|
LockMemory(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
JackShmMem::~JackShmMem() |
|
|
|
{ |
|
|
|
UnlockMemory(); |
|
|
@@ -45,7 +45,7 @@ void JackShmMemAble::Init() |
|
|
|
fInfo.ptr.attached_at = gInfo.ptr.attached_at; |
|
|
|
fInfo.size = gInfo.size; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void* JackShmMem::operator new(size_t size, void* memory) |
|
|
|
{ |
|
|
|
jack_log("JackShmMem::new placement size = %ld", size); |
|
|
@@ -100,7 +100,7 @@ void JackShmMem::operator delete(void* p, size_t size) |
|
|
|
} |
|
|
|
|
|
|
|
void JackShmMem::operator delete(void* obj) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (obj) { |
|
|
|
JackShmMem::operator delete(obj, 0); |
|
|
|
} |
|
|
@@ -111,7 +111,11 @@ void LockMemoryImp(void* ptr, size_t size) |
|
|
|
if (CHECK_MLOCK((char*)ptr, size)) { |
|
|
|
jack_log("Succeeded in locking %u byte memory area", size); |
|
|
|
} else { |
|
|
|
#ifdef WIN32 |
|
|
|
jack_error("Cannot lock down memory area size = %d (%d)", size, GetLastError()); |
|
|
|
#else |
|
|
|
jack_error("Cannot lock down memory area (%s)", strerror(errno)); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -121,7 +125,11 @@ void InitLockMemoryImp(void* ptr, size_t size) |
|
|
|
memset(ptr, 0, size); |
|
|
|
jack_log("Succeeded in locking %u byte memory area", size); |
|
|
|
} else { |
|
|
|
#ifdef WIN32 |
|
|
|
jack_error("Cannot lock down memory area (%d)", GetLastError()); |
|
|
|
#else |
|
|
|
jack_error("Cannot lock down memory area (%s)", strerror(errno)); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|