New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite the way LLVM JIT does memory allocation to allow use of more than one contiguous segment #6771
Conversation
Because this is not a reliable solution |
Would just changing s_memory_size to a larger value be more "reliable" ? |
No, need to eliminate this approach to allocation completely. |
I've thought about writing a simple page-sized allocator into the space that's already there but since theres no deallocateCodeSection/deallocateDataSection functions that will ever be called anyway that would be a bit pointless, unless the allocator would just be there to allow usage of another memory region when the first one is exausted ? |
I have written a new LLVM JIT memory allocator to take advantage of multiple segments so there really should be no way to get LLVM out of memory now (unless actual alloc call fails). Because LLVM can never deallocate JIT memory as it is now, I see no better way. |
0a620de
to
9c2cc38
Compare
Thank you very much! It works like a charm in MG4. I have encountered an unsolved PPU cache 137 modules compilation error before .The cache is compiled successfully with this build. |
this could fix Elveon not running on rpcs3, using llvm |
…than one contiguous segment
Well, this approach can work for now. Although I don't get the point of calling reserve/reset instead of allocating all possible segments at startup. |
Everything accessible in the low <2GB area is already reserved at startup. |
I meant emulator startup. Code under MAP_32BIT path doesn't seem to do it. |
Ok, I've changed the MAP_32BIT path to greedy reserve as much as it can as well. |
…AP_32BIT is used as well
@rajkosto Hey you over here, i know you from Nintendo Switch scene ;) (Sorry for the offtopic) |
…than one contiguous segment (RPCS3#6771)
I don't see why not ? Is this low area of memory used for anything else ?
Avoids LLVM out of memory fatal error when too many PPU modules get compiled and linked in.