[LLVMdev] Making LLVM safer in out-of-memory situations

Philip Reames listmail at philipreames.com
Mon Jan 13 16:43:42 PST 2014

I've glanced over the patch and the change looks reasonable to me.  I 
would definitely want to get Andy's feedback on the change since he's 
the owner and primary maintainer of this code.

As you suggest, it's probably time to move this to LLVM commits.


On 1/9/14 4:23 AM, Gasiunas, Vaidas wrote:
> Hi Andy,
> I ported our patch for the precalculation of size to LLVM trunk and wrote a small unit test for it. The basic idea is that RuntimeDyld after creating ObjectImage, but before loading it notifies the memory manager about the total space required to allocate all sections.
> Note that we coded it for our requirements, so it may still need some adjustments to make it general enough for all possible uses. For example, I am not sure what would be the best way to make this calculation of size optional. For example, I could add another virtual method in the memory manager, to ask whether it needs the information about total size.
> BTW do you think we should move further discussion to llvm-commits?
> Regards,
> Vaidas
> -----Original Message-----
> From: Kaylor, Andrew [mailto:andrew.kaylor at intel.com]
> Sent: Freitag, 3. Januar 2014 19:13
> To: Gasiunas, Vaidas; Philip Reames; LLVM Dev
> Subject: RE: [LLVMdev] Making LLVM safer in out-of-memory situations
> Hi Vaidas,
> Thanks for the feedback.
> Regarding the single allocation, I'm not opposed to having an option to pre-calculate the size and provide it in advance to the memory manager.  We actually had an implementation that worked that way once, but it never got checked in because we decided the associated implementation was too complicated to use as the base memory manager.  The pre-calculation will need to be optional so that extra calculation isn't imposed on clients that don't need it.
> With your explanation below I understand the issue with function address mapping.  You've probably seen that RuntimeDyld already keeps a map of symbol names to addresses.  My concern with having RuntimeDyld keep the additional information to lookup symbols based on addresses is that MCJIT already consumes more memory than we'd like.  If you can make your implementation work with the ObjectImage that would probably be best.
> -Andy
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140113/8222367a/attachment.html>

More information about the llvm-dev mailing list