android - SHM replacement based on ASHMEM -


i'm working on library port *nix android, , library uses shared memory or shm. android not have system v shm. instead uses ashmem.

is aware of shim library map shm calls ashmem? google has not been helpful.

this how worked me while working similar problem of porting:

instead of using shmfd = open(shm_path, o_rdwr) creating , getting file descriptor replaced with

int fd = ashmem_create_region("sharedregionname", size);  

and used file descriptor base address:

int base_address = mmap(null, size, prot_read | prot_write, map_shared, fd, 0); 

you can pass base_address java code native code using native function returns descriptor.

android has wrapper class ashmem named memoryfile. can have in that.

the following links helped me create own wrapper:


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -