temperror
2011-Oct-25 19:38 UTC
[Wine] Need help with modifying Wine memory allocation in NTDLL
Greetings! We are building a project in which we need Wine to allocate its memory in a shared memory that would be accessible to our custom sub-processes. We use Wine to run Unity3D. So far so good. Now, the idea is to run 3 independent sub-processes, each with its own graphical context (one per GPU on a 3 GPU machine), which would need to have access to client-side buffers (indices, normals, vertices, etc.). So, in order to do just that, when Unity demands to create such buffers, we want Wine to create these for Unity in shared memory, and then pass the shared memory pointers to the sub processes. We have explored the map_view and wine_mmap_enum_reserved_areas functions, where memory is allocated. But before we break anything, we'd like to know if there's a recommended, or best, way to do this. Thanks so much in advance!
vitamin
2011-Oct-26 02:20 UTC
[Wine] Re: Need help with modifying Wine memory allocation in NTDLL
temperror wrote:> We are building a project in which we need Wine to allocate its memory in a shared memory that would be accessible to our custom sub-processes.So why do you need to modify Wine? If you running all processes withing one instance of Wine you can use standard Windows techniques to create shared memory. Nothing special here.
vitamin
2011-Oct-30 00:02 UTC
[Wine] Re: Need help with modifying Wine memory allocation in NTDLL
temperror wrote:> The only thing we can do is recognize when memory is demanded by Unity to Wine, and then make sure it is shared memory that's allocated.Good luck with that. Most applications will be allocating/freeing lots of memory all the time. And most of it will be from default application's heap. This can't really be shared, or you risking breaking everything inside Wine. This memory used be everything, not just your application. The only remote chance if your app virtual allocks some big section for internal use.