Very interesting, all. However, I have two questions:

1) What's the benefit to passing around all these C function pointers
(which, I notice, aren't properly parsed in ATTR definitions yet),
above creating a subclass of ManagedStruct to use
executable-code-specific clone() and destroy() methods? Asked a
different way, how many different configurations do we forsee having,
and are they enough to justify tacking this kind of ability onto the
ManagedStruct PMC?
2) Is ManagedStruct really the best thing to be holding JIT-related
code pages? I can think of other jobs that a real JITBuffer PMC could
be used for eventually besides simply holding, cloning, and freeing
code pages.

--Andrew Whitworth

On Wed, Apr 8, 2009 at 10:14 AM, Mark Glines <[email protected]> wrote:
> Hi,
>
> I'm working on TT #18, trying to solve an issue with JIT segfaulting on
> machines with nonexecutable heaps.  (As can be caused by Selinux and
> possibly other similar systems.)  I'm starting with NCI JIT, once we get
> that right we can switch over all the other JIT too.
>
> So I've added the necessary "size" argument to various functions and got
> mmap-based buffer allocation working.  The first problem I hit was that
> the existing code blindly tries to call free() (rather than munmap) when
> the ManagedStruct PMC referencing the buffer was garbage collected.
> Which means we need a custom free() handler which does munmap() instead
> of free() (with the proper "size" argument), and also a custom clone()
> handler is needed for similar reasons.
>
> Yesterday we had a design discussion in #parrot about this, mainly
> revolving around which PMC to add the necessary functionality to.  We
> (Santtu++ and I) had made a couple of patchsets which took different
> approaches to the problem.  In the end, chromatic++ preferred to keep
> using (and extending) ManagedStruct, and to keep the custom-free and
> custom-clone features as generic as possible in the hopes that they'll
> be reusable for other things later.  So I've reworked my previous set of
> patches to do this.
>
> That particular feature is implemented in
> https://trac.parrot.org/parrot/attachment/ticket/18/02_managedstruct-free_func-attr.patch.txt
> .  I would love to get that patch reviewed to make sure we're headed in
> the right direction this time.  If needed, a subsequent patch (patch 03,
> attached to the same ticket) provides an example of how to use the feature.
>
> Mark
> _______________________________________________
> http://lists.parrot.org/mailman/listinfo/parrot-dev
>
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to