small improvement to the shared memory physics server/client

This commit is contained in:
=
2015-05-28 17:49:55 -07:00
parent 82576d0bee
commit 7abefca6f1
4 changed files with 96 additions and 22 deletions

View File

@@ -1,8 +1,10 @@
#include "PosixSharedMemory.h"
#include "Bullet3Common/b3Logging.h"
#include "LinearMath/btScalar.h" //for btAssert
#ifdef __APPLE__
//#define TEST_SHARED_MEMORY
#define TEST_SHARED_MEMORY
#endif
#include <stddef.h>
@@ -71,13 +73,13 @@ void PosixSharedMemory::releaseSharedMemory(int key, int size)
int id = shmget((key_t) key, (size_t) size,flags);
if (id < 0)
{
b3Error("shmget error");
b3Error("PosixSharedMemory::releaseSharedMemory: shmget error");
} else
{
int result = shmctl(id,IPC_RMID,0);
if (result == -1)
{
b3Error("shmat returned -1");
b3Error("PosixSharedMemory::releaseSharedMemory: shmat returned -1");
}
}
#endif