On 1 May 2013 08:04, Akers, Jason B <jason.b.akers@xxxxxxxxx> wrote: > I wrapped the ashmem calls with the existing shm* function definitions. It's a little ugly, but makes for an easy patch touching only os/os-android.h. > > Tested on both arm and x86 android phones. > > [..] > > static inline int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) > { > - return syscall(__NR_shmctl, __shmid, __cmd, __buf); > + int ret=0; > + if (__cmd == IPC_RMID) > + { > + int length = ioctl(__shmid, ASHMEM_GET_SIZE, NULL); > + struct ashmem_pin pin = {0 , length}; > + ret = ioctl(__shmid, ASHMEM_UNPIN, &pin); I'm not sure that you want to make the region unpinned. How can we recover if the region is reclaimed? Other than that, my only comment would be that these functions shouldn't be static inline since they're quite big, but since there are only a few callsites it's probably not a big deal. -- Aaron -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html