This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: non-gcc related question: Language that allows defining non-swappable regions of code
- From: Bernd Jendrissek <berndj at prism dot co dot za>
- To: Rene Rebe <rene dot rebe at gmx dot net>
- Cc: devcore at freeuk dot com, gcc at gcc dot gnu dot org
- Date: Tue, 3 Sep 2002 00:11:42 +0200
- Subject: Re: non-gcc related question: Language that allows defining non-swappable regions of code
- References: <20020902.073147.730578480.rene.rebe@gmx.net>
On Mon, Sep 02, 2002 at 07:31:47AM +0200, Rene Rebe wrote:
> On: 01 Sep 2002 22:16:24 -0700,
> Kristis Makris <devcore@freeuk.com> wrote:
> > Hello,
> >
> > This is more of a theoretical question that does not directly relate to
> > gcc and it's development, and I hope it's not too intrusive. I was
> > wondering if there exists a language, or an extension to a language,
> > that allows specifying blocks of source code that should be loaded by
> > the underlying operating system to a memory area that cannot be swapped
> > out of memory.
>
> [...]
>
> You might to visit the man-page of:
>
> mlock (2) - disable paging for some parts of memory
> mlockall (2) - disable paging for calling process
> munlock (2) - reenable paging for some parts of memory
> munlockall (2) - reenable paging for calling process
>
> Such features have nothing to do in a programming language ...
gcc-help@gcc.gnu.org next time...
You can use __attribute__((section("unswapped"))) in conjunction with
this. There's nothing special about the name "unswapped"; just make sure
your output file format supports arbitrary section names.
Consider using a linker script to place whole modules in unswapped regions.
That does not require language extensions either.
Look at linux kernel code - it uses section attributes extensively, as well
as a linker script so the linker knows what to do with these sections.
bernd
--
berndfoobar@users.sourceforge.net is probably better to bookmark than any
employer-specific email address I may have appearing in the headers.
Vanity page: http://www.tsct.co.za/~berndj/