#18: Jit code buffers need to be allocated via mmap()
-----------------------+----------------------------------------------------
Reporter: Infinoid | Type: bug
Status: new | Priority: normal
Milestone: | Component: none
Version: | Severity: none
Keywords: JIT patch | Lang:
Patch: new | Platform:
-----------------------+----------------------------------------------------
Comment(by santtu):
I added two patches, first one is just update on earlier 01* patch. The
second one takes alternative approach to 02*.
The 02 patch is needed, because if mmap/munmap is used, the munmap *must*
be called with correct size value. Thus parrot needs to keep the actual
JIT memory block allocation size somewhere around. ManagedStruct already
has size parameter (int struct value), but it for JIT code it needed to be
passed to mem_free_executable. Thus the 02 patch added custom free
routine.
I chose instead to not modify existing ManagedStruct, which probably has
other uses too and is overloaded with many accessors (via extending
UnmanagedStruct). The JIT code basically just needs to be GCable and
accessible from parrot C core -- not really PIR code at all so any
accessors etc. are unused. Thus the JitCode PMC is very simple -- it just
holds memory pointer and its size, and calls mem_free_executable when
GCed.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/18#comment:6>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets