<div dir="ltr">On Fri, May 17, 2013 at 12:41 PM, Filip Pizlo <span dir="ltr"><<a href="mailto:fpizlo@apple.com" target="_blank">fpizlo@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im"><br></div><div><br></div><div>So what about going with this (I don't know if this is what Sean was thinking or if this is my idea):</div>
<div><br></div><div>- LLVMCustomMCJITMemoryManager is an opaque.</div><div><br></div><div>- You create it with:</div><div><br></div><div>LLVMCreateCustomMCJITMemoryManager(void *Object, uint8_t *(*AllocateCodeSegment)(...), uint8_t *(*AllocateDataSegment)(...), LLVMBool (*ApplyPermissions)(...), void (*Destroy)(...));</div>
<div><br></div></div></div></blockquote><div><br></div><div style>This makes a lot of sense to me. What I initially had in mind was basically the same idea, but with a getter/setter for each field, but this design you are suggesting seems more robust for this use case, since it centralizes the "have you filled in all the required fields" checking. </div>
<div style><br></div><div style>Your suggestion is also superior because it eliminates a class of errors (and races, in a multithreaded context) where the MCJMM is mutated via a setter while it is already in use.</div><div style>
<br></div><div style>-- Sean Silva </div></div></div></div>