subroutine stack and C machine model

R

robertwessel2

  There is another case, where this will not work:

  When there are many functions with a huge size of
  automatic storage, but during each run of the program
  only one of them is being called.

  With memory allocation at run-time only the memory
  for the one function called will be allocated, which
  might still fit into available memory.

  When automatic memory is allocated statically once for
  every function, the total amount of memory allocated
  might exceed memory limitations.


While that's true, and might be a problem in some cases, it doesn't
invalidate the scheme. You just have a QoI issue where the static
allocation of your program is larger than you'd hope for. Nor is it
necessarily a problem - if these functions with huge automatic
allocations are all leaf functions (or otherwise guaranteed not to be
in each other's call chains), it would be trivial for the compiler to
share a static area for the automatics for all of those functions.
And then there's the flip side - stacks are often much, much smaller
than the possible static area, and functions that have "huge"
automatic areas tend not to fit well on the stack, which will might
them fail in any case. On the third hand, some compilers will
allocate excessively large automatic areas on the heap, which solves
the problem in either case.
 
U

user923005

Well, I do. It's not vital though...


Right. But I need to know what is offensive about it.


For disliking it yes, but I don't think this is enough to explain it's
offensiveness

Maybe he doesn't like Ernest Maurice Vandeweghe III.
Perhaps you would like it if I called you "Jochie-poo" or perhaps you
would find it offensive.
If I started calling you that, and you said you didn't like it, I
would not require an explanation.
 
R

robertwessel2

[machines without dedictaed hardware stacks]
And IBM 360 (maybe you did not know that) stopped being produced
at the beginning of the seventies, last century...
with a bit of googling:-
"The zSeries line succeeded the System/390 line (S/390 for short),
maintaining
 full backward compatibility. In effect, zSeries machines are the
direct, lineal
 descendants of System/360, announced in 1964, and the System/370 from
1970s.
 Applications written for these systems can still run, unmodified,
with only
 few exceptions, on the newest System z over four decades later."

Without actually delving into the details, being backwards compatible
doesn't preclude the newer models from having hardware stacks.- Hide quoted text -


For ordinary program use they still do not.

The closest thing is the linkage stack, which is used with a call-gate-
like mechanism to allow transfers of control between different
applications, including calls between different address spaces. The
linkage stack itself is protected from the applications (although the
application can use a specific instruction to put some data into a
linkage stack entry to facilitate parameter passing), and is not a
single contiguous structure (it's a linked list of areas no more than
about 64KB each).

While you could abuse the linkage stack and use it for ordinary
function calls, it's very heavyweight (not least, each stack entry is
296 bytes), and would perform very badly for that purpose. Nor do the
typical OS's usually set up a large linkage stack by default (rather
as stack full exceptions occur, they extend the linked list of stack
spaces).
 
B

Ben Bacarisse

James Dow Allen said:
[...] I'm fishing for an execution model that uses the [setjump/longjmp]
functions.  

poor mans exception handler

It can also be used as a carefree man's backtracker as at
http://james.fabpedigree.com/rrome.htm
where the calls occur from the following macros:

#define EITHER if (S[1] = S[0], ! setjmp((S++)->jb)) {
#define OR } else EITHER
#define REJECT longjmp((--S)->jb, 1)
#define END_EITHER } else REJECT;

Just a word of warning: the behaviour of the above is undefined due to
the severe limits placed on the way setjmp can be called.

Basically you can have nothing more complex than !setjmp(...) or
setjmp [relational or equality op] [integer constant expression] as
the controlling expression of an if/switch/while/for/do.
 
S

Seebs

No it isn't. It's a nickname.

Non sequitur.

Something is offensive if it offends. Being a "nickname" does not make
something magically inoffensive.

But, since you seem to want to play, let's go explain the details.

Nicknames are used as a social signal. In general, nicknames can be
either friendly or unfriendly. A friendly nickname is used to denote
closeness or affection. An unfriendly nickname is used to denote hostility
or derision.

It is not always possible to tell, just looking at the nickname, which
is which. However, there is a useful pattern: If someone responds
negatively to a nickname, its continued use is absolutely,
unambiguously, unfriendly.

Given that, we can certainly and reasonably assert that the continued use
of the nickname is hostile and intended to be offensive, and that it is
reasonable for Keith to treat it as a willful intent.

It is, of course, theoretically possible that there could be a circumstance
in which someone was continuing to use a disliked nickname without hostile
intent, but in a case where it is coupled with other derisive or hostile
remarks and behaviors, there's really no practical ambiguity. Spend your
time worrying about SHA1 checksum clashes, they're more likely.

-s
 
K

Keith Thompson

Seebs said:
It is not always possible to tell, just looking at the nickname, which
is which. However, there is a useful pattern: If someone responds
negatively to a nickname, its continued use is absolutely,
unambiguously, unfriendly.
[...]

For the record, I'm not aware of anyone having used this nickname
after I expressed my dislike for it.
 
N

Nick Keighley

Well, I do. It's not vital though...


Right. But I need to know what is offensive about it.

?? if someone uses a name for him that he dislikes and only uses to
cause
offense then isn't almost by definition offensive?

I mean this is playgound stuff shouldn't we have grown out of this
sort of
thing?

And *why* do you need to know why its offensive? Surely Keith's
dislike
of it it enough for a polite and reasonable person to desist using it.
 
F

Frank

In Dread Ink, the Grave Hand of Keith Thompson Did Inscribe:
"Kiki" appears to be KM's deliberately offensive nickname for me.
I'll thank you not to use it.

How's Chuck?
--
Frank

The biases the media has are much bigger than conservative or liberal.
They're about getting ratings, about making money, about doing stories that
are easy to cover.
~~ Al Franken,
 
F

Frank

In Dread Ink, the Grave Hand of Richard Heathfield Did Inscribe:
Oh, okay. Thanks for the interpretation. I note that, if "Frank"'s
recent posting history is anything to go by, his criticisms are not
terribly valuable.

<snip>

Ohmiheck. Would you care to pick a page number for _C Unleashed_ and have
me tell you the proximity of typing errors?

Do you think that an integer exists, such that I can't find a typo within
15 pages?

Oh and remember--you can't read.
--
Frank

When you encounter seemingly good advice that contradicts other seemingly
good advice, ignore them both.
~~ Al Franken,
 
J

Joachim Schmitz

Keith said:
Ok, now I'm curious. *Why* do you need to know? What difference
could it possibly make to you?

The phrase "need to know" usually implies something more than
curiosity, for example that you have a real need to do something,
or refrain from doing something, based on the information.

Curiosity is a strong motive. Without it no progress would be made at all.
To clarify my earlier remarks a bit, what I wrote previously was:

"Kiki" appears to be KM's deliberately offensive nickname for me.

What I meant, I suppose, was that KM intended it to be offensive (an
assumption, but a safe one), not that the name itself is inherently
offensive (it certainly wouldn't be if that were really my name).

OK, understood now. Guess I was reading to much into it

Bye, Jojo
 
J

Joachim Schmitz

user923005 said:
Maybe he doesn't like Ernest Maurice Vandeweghe III.
Perhaps you would like it if I called you "Jochie-poo" or perhaps you
would find it offensive.

I certainly wouldn't like it, but I would find it offensive.
I'd ask you to stop using it.
I'd indeed find it offensive if you'd continue to use it.
If I started calling you that, and you said you didn't like it, I
would not require an explanation.

I wasn't asking why Keith doesn't like it, just why he found it offensive

Bye, Jojo
 
J

Joachim Schmitz

Nick said:
?? if someone uses a name for him that he dislikes and only uses to
cause
offense then isn't almost by definition offensive?

Almost, possibly
I mean this is playgound stuff shouldn't we have grown out of this
sort of
thing?

And *why* do you need to know why its offensive? Surely Keith's
dislike
of it it enough for a polite and reasonable person to desist using it.

I think I explaind at length. Yes repeated use despite an expressed dislike
is offensive.
The nickname itself seems not, and I seeked clarification about that, no
more.

Bye, Jojo
 
J

Joachim Schmitz

Kenny said:
How do you know (what makes you think) it is an attempt to antagonize
him ? How do you know (what makes you think) it is juvenile ?

Well, the next time you use it, we know for sure.

Bye, Jojo
 
J

Joachim Schmitz

Default said:
Besides what the others have mentioned, in English-speaking countries
it's generally a female name.

Hmm, here too (but not exclisivly), but I think females might be offended of
you to think of a female nicknames to be offensive...

Bye, Jojo
 
B

bartc

Joachim Schmitz said:
Hmm, here too (but not exclisivly), but I think females might be offended
of you to think of a female nicknames to be offensive...

You just don't seem to get it. What exactly do you have to call somebody in
public, in your part of the world, to belittle them and show contempt and
disrespect?
 
N

Nick Keighley

Hmm, here too (but not exclisivly), but I think females might be offended of
you to think of a female nicknames to be offensive...

applying a female name to a male person might quite well be offensive
to the male person.

Are you from Mars or something?
 
J

James Kuyper

bartc said:
You just don't seem to get it. What exactly do you have to call somebody
in public, in your part of the world, to belittle them and show contempt
and disrespect?

It's somewhat sexist that using a feminine nickname for someone is a way
"to belittle them and show contempt and disrespect". Which is not to say
this isn't true - we do live in a sexist society.

The key point is that KM routinely displayed contempt and disrespect
when using this nickname, which tends to remove any reasonable doubts
about whether it was intended to be contemptuous and disrespectful.
 
J

James Kuyper

Frank said:
In Dread Ink, the Grave Hand of Richard Heathfield Did Inscribe:
....
Ohmiheck. Would you care to pick a page number for _C Unleashed_ and have
me tell you the proximity of typing errors?

Well, if you consider "favourite" to be a typing error, I'm sure you'll
find lots of them in any book written in British English. That would
tell us more about your ignorance than about the quality of the
proofreading.
 
J

Joachim Schmitz

Nick said:
applying a female name to a male person might quite well be offensive
to the male person.

That's not what Brian said (but might well have been what he meant)
Are you from Mars or something?

Not quite. I just deliberatly took Brian by what he said and forgot to add a
smiley...

Bye, Jojo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top