unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Allocating Executable Memory
@ 2010-06-05 18:28 Noah Lavine
  2010-06-06 14:15 ` Ludovic Courtès
  2010-06-06 19:54 ` Andy Wingo
  0 siblings, 2 replies; 3+ messages in thread
From: Noah Lavine @ 2010-06-05 18:28 UTC (permalink / raw)
  To: guile-devel

This issue is somewhat related to the question of how to build a JIT,
but will also apply later when we try to attach GCC or some other
system to Guile.

The question is, how does one modify the Guile memory allocation
system so that you can request that some memory be executable? You
could make all memory executable, but that's probably not great for
security. You could allocate executable memory as-needed, as part of a
program or objcode structure, and free it when the structure is freed,
but it only comes in page-size chunks, so this would probably lead to
a huge over-use of memory. It seems like the right solution is to give
the GC system the ability to manage executable memory at the user's
request, but that will require some modifications.

So, people who are familiar with the GC system, where should those
modifications be made, and how would you do it?

Noah



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Allocating Executable Memory
  2010-06-05 18:28 Allocating Executable Memory Noah Lavine
@ 2010-06-06 14:15 ` Ludovic Courtès
  2010-06-06 19:54 ` Andy Wingo
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2010-06-06 14:15 UTC (permalink / raw)
  To: guile-devel

Hi Noah!

Noah Lavine <noah.b.lavine@gmail.com> writes:

> The question is, how does one modify the Guile memory allocation
> system so that you can request that some memory be executable?

Currently you can’t.  You’d need mmap(3) and/or mprotect(3) bindings,
which would probably be useful anyway, though there are portability
issues with these.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Allocating Executable Memory
  2010-06-05 18:28 Allocating Executable Memory Noah Lavine
  2010-06-06 14:15 ` Ludovic Courtès
@ 2010-06-06 19:54 ` Andy Wingo
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2010-06-06 19:54 UTC (permalink / raw)
  To: Noah Lavine; +Cc: guile-devel

On Sat 05 Jun 2010 20:28, Noah Lavine <noah.b.lavine@gmail.com> writes:

> It seems like the right solution is to give the GC system the ability
> to manage executable memory at the user's request, but that will
> require some modifications.
>
> So, people who are familiar with the GC system, where should those
> modifications be made, and how would you do it?

The best thing would be to modify libgc to provide hooks to manage
executable memory. Otherwise you would have to implement an executable
memory manager on top of mmap et al, and make GC-managed objects that
are associated with that executable memory, with finalizers or
guardians.

A
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-06 19:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-05 18:28 Allocating Executable Memory Noah Lavine
2010-06-06 14:15 ` Ludovic Courtès
2010-06-06 19:54 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).