[Oberon] Clarifying type compatibility in Oberon-07

Luca Boasso luke.boasso at gmail.com
Thu Oct 12 16:48:23 CEST 2017


Wouldn't you need a frame pointer to implement it? The current compiler
does not need one, since the stack frame size is know at compile time,
adding this feature would break this invariant. Am I missing something?



On Oct 12, 2017 05:45, "Andreas Pirklbauer" <andreas_pirklbauer at yahoo.com>
wrote:

> > We support an extension in the Astrobe for ARM Cortex-M compilers that
> > allows single-dimensional dynamic local array variables. This was
> originally
> > implemented in Wirth's earlier ARM Oberon compiler but not in his RISC5
> compiler.
> > The NEW command in this case allocates space on the stack (not the heap)
> for
> > the local array. This is elegant because it doesn't require any
> corresponding
> > DISPOSE or garbage collection - the space is automatically reclaimed when
> > the procedure is exited. The example above then becomes:
> > > PROCEDURE P(s: ARRAY OF CHAR); > VAR local: ARRAY OF CHAR; > BEGIN >
> NEW(local, LEN(s)); > local := s; > ...
>
> That’s a great idea!! So NEW(a, size) only touches the stack but not the
> heap,
> making both allocation and reclamation (which is of course implicit on
> procedure
> exit by simply adjust the stack pointer) super-fast.
>
> I will consider adding that to my version of the compiler!
>
> -AP
>
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20171012/1b3dfc09/attachment-0001.html>


More information about the Oberon mailing list