i am trying to find an easy way to alloc executable memory for QNX 6.3.2. For Suse i am using mmap and i map my code to an anonymous region. I’ve already seen that QNX does not allow to alloc anonymous memory. The only way i am just thinking of is to use shm_open and to map the code into a file. Does somebody over here knows a different way to do it (beware it has to be executable). Thanks
How about a dll?
probably a little bit more backround is needed. The main reason i need to be able to alloc executable memory is the use for a JIT compiler. So the code generation is being done dynamically and its also being executed frequently. The main problem is also not to have many times access to compiled code on local harddisc not to decrease the execution speed. To create a dll is a misplaced idea for this purpose i think
You could get memory via mmap with the PROT_EXEC flag.
Can you clarify why you think we don’t allow anonymous allocations?
mmap( 0, size, PROT_EXEC|PROT_READ, MAP_ANON|MAP_PRIVATE, NOFD, 0);
not do the trick for you?