gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] Re: LENGTH() on Solaris 10/sparc


From: gaius
Subject: Re: [Gm2] Re: LENGTH() on Solaris 10/sparc
Date: Wed, 04 Aug 2010 05:18:44 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

"Fischlin  Andreas" <address@hidden> writes:

> Dear Gaius,
>
> One last attempt. Afterwards I will give up. Promised. ;-)

Hi Andreas,

no problem - great to have the feedback!

> af writes: In my understanding not quite the same or not necessary
> the same. I expect Terminate to be a really low level call to the
> hardware halting the currently running process. However,
> ExecuteTerminationProcedures does nothing of the sort. It merely
> executes all installed termination procedures. A typical sequence
> would then be
>
> ExecuteTerminationProcedures; Terminate;
>
> In particular in a dynamic loader situation, Terminate would merely
> abort the current level and leave the rest of the process stack
> intact.
>
> The question also arises what is the relationship to HALT. HALT may
> be the same as Terminate, in particular in a single level system as
> all statically linked run-time environments such as that of C
> are. But as a n implementer you are free to also interpret HALT as
> simply first breaking the program, as any other break point set, and
> allow the user the choice of either calling the debugger or perhaps
> continuing the process if no abnormal condition was encountered or
> to abort the program. Only in the last situation you would then call
>
> ExecuteTerminationProcedures; Terminate;

ok I'll implement reimplement Terminate to behave as HALT
except it calls exit rather than abort.

> Gaius wrote:
>
> I believe the StrLib.StrEqual code behaves in the same way as StrEqual
> above.  (It uses StrLen to determine the length of the strings under
> comparison which handles the ASCII.nul case).  Unless I've
> misunderstood something?
>
>
> ___________________
> af writes: But above routine is IMHO still not a
> particularly good one, since it is very inefficient. It makes at
> least 2 and up to 4 passes through the 2 string variables, while my
> proposals make up to a max of 2 passes as unavoidable. If the two
> strings differ in the first char, that first char comparison is all
> what is needed and the routine already returns FALSE. Please replace
> above routine with one of mine's. That may quite matter with large
> string arrays.

indeed, I'll reimplement StrEqual more efficiently..  and LENGTH will
be inlined post gm2 1.0.  M2RTS currently contains pervasive runtime
support procedures and function procedures and is automatically
included in any link.  I'll remove any reference to ASCII.nul.  There
is a minimal version of M2RTS.mod in gm2/gm2-libs-min/ which is pretty
useful for embedded targets.

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]