Bug 607534 - Optimize custom dynamic loader to use less memory, r=cjones a=blocking-fennec
This commit is contained in:
@@ -56,15 +56,7 @@
|
||||
// Temporarily go directly to the kernel interface until we can
|
||||
// interact better with libcutils.
|
||||
//
|
||||
#define ASHMEM_DEVICE "/dev/ashmem"
|
||||
#define ASHMEM_NAME_LEN 256
|
||||
#define __ASHMEMIOC 0x77
|
||||
#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
|
||||
#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN])
|
||||
#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
|
||||
#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
|
||||
#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long)
|
||||
#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6)
|
||||
#include <linux/ashmem.h>
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
@@ -102,7 +94,7 @@ SharedMemoryBasic::Create(size_t aNbytes)
|
||||
NS_ABORT_IF_FALSE(-1 == mShmFd, "Already Create()d");
|
||||
|
||||
// Carve a new instance off of /dev/ashmem
|
||||
int shmfd = open(ASHMEM_DEVICE, O_RDWR, 0600);
|
||||
int shmfd = open("/" ASHMEM_NAME_DEF, O_RDWR, 0600);
|
||||
if (-1 == shmfd) {
|
||||
LogError("ShmemAndroid::Create():open");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user