[LLVMdev] JIT allocates global data in function body memory
evan.cheng at apple.com
Mon Jul 6 11:00:18 PDT 2009
On Jul 2, 2009, at 5:20 PM, Reid Kleckner wrote:
> On Thu, Jul 2, 2009 at 3:09 PM, Evan Cheng<evan.cheng at apple.com>
>> The patch looks good to me. But we cannot allow AllocateGVsWithCode
>> be initialized to be false yet. Can you add a mechanism to define the
>> behavior when the JIT is created / initialized?
> That makes four optional arguments to ExecutionEngine::create. Do you
> mind if I go ahead and add an EngineBuilder?
>> Also, I am not crazy about this being moved to JITMemoryManager.h.
>> This seems like implementation detail that should be kept hidden.
>> + // If the PoisonMemory parameter is true, freed memory should be
>> + // with garbage. This parameter is useful for testing and
>> +#ifdef NDEBUG
>> +#define POISON true
>> +#define POISON false
> I wasn't crazy about it either, but it was hard to construct a
> unittest that fails properly under release mode without it. It also
> seems like it would be a useful feature for writing unit tests for
> other custom memory managers. I can either axe it and let the test
> only do proper testing in debug mode, or I could add a
> setPoisonMemory(bool poison) method to the JITMemoryManager interface.
> Which would you prefer?
My preference would be to add a method to JITMemoryManager.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev