Re: where? heap or stack?
From: Leor Zolman (leor_at_bdsoft.com)
Date: 05/06/04
- Next message: Andrey Tarasevich: "Re: template trick?"
- Previous message: Martin Dickopp: "Re: Maximum for Arrays in C/C++"
- In reply to: Claudio Puviani: "Re: where? heap or stack?"
- Next in thread: Claudio Puviani: "Re: where? heap or stack?"
- Reply: Claudio Puviani: "Re: where? heap or stack?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 05 May 2004 22:08:29 GMT
On Wed, 05 May 2004 21:10:16 GMT, "Claudio Puviani" <puviani@hotmail.com>
wrote:
>>
>> All of which I have no problem with; the point I was trying to make is that
>> this distinction is usually /beside the point/ in the context of many
>> (most?) questions that arise concerning dynamic memory.
>
>But it WAS in context with respect to the statement you made that Eckel makes no
>distinction between 'heap' and 'free store'.
Perhaps you misconstrued my point; I wasn't bringing up the use of "heap"
in the book to parade it as evidence of equivalence between "heap" and
"free store". I don't believe for a second that Chuck Allison and Bruce
Eckel aren't aware of the distinction. Rather, I believe a conscious
decision was made to downplay that distinction, perhaps because to bring it
up just injects gratuitous complexity in cases when there's no need to
worry about it.
If you thought I was arguing that heap and free store are the same, then I
can understand your citing Herb's writing. The context I was referring to
above, however, was the OP's post, not the Eckel/Allison book.
>
>> A continuous challenge in newsgroup postings (esp. responses), and one I
>> always struggle with personally, is to know how much detail to go into.
>> Often you just can't tell without the proverbial crystal ball; thus, my
>> instinct is to err on the side of providing /less/ detail, and not to open
>> Pandora's box if it isn't clear the OP has requested it opened.
>
>That's a personal choice. My preference is to give more detail if giving less
>detail creates an ambiguity, as was the case with 'heap' and 'free store'.
Okay, I respect where you're coming from. Until seeing the treatment that
this terminology got in the book, I would have been inclined to agree with
you in principle. But now I'm leaning toward avoidance of bringing up any
distinction between heap and free store in a thread unless some question
truly specific to that distinction arises.
>
>> Not to beat a dead horse (or further pummel Jeff), but take a look at the
>> subject of the OP's question in this thread, and at the body of that
>> question. Do you really think this particular OP really needed to know that
>> the "heap" was something other than the free store (maybe)? I don't think
>> so.
>
>I disagree. If the OP was ready to discuss the distinctions between 'heap' and
>'stack', including the other storage classes in the conversation is completely
>appropriate.
This is where the crystal ball comes in handy. I look into mine and see a
question concerning the difference between static and dynamic allocation at
an elementary level; you may look and see deeper questions. We must each
follow our own muse, I guess.
>
>> He may not even have been aware that there was any such thing as
>> "malloc" and "free"; certainly, someone learning C++ the modern way would
>> have no need to know about those functions (yet).
>
>Again, we disagree. I think the OP is better off knowing about them so that if he
>encounters them, he'll be aware of what he's facing.
>
>> This is precisely where a little bit of restraint would, IMHO, go a long way.
>
>I was restrained. I didn't go into custom allocators or exception considerations
>during allocations or any other tangential topics. The OP's question, whether he
>realized it or not, was about storage classes and now he knows more about the
>topic.
Okay, Claudio; I have considerable respect for your postings and
experience, while I'm a relative newbie at all this. I just try to put
something out when I think the differing perspective might possibly end up
doing some good.
No worries,
-leor
>
>Claudio Puviani
>
-- Leor Zolman --- BD Software --- www.bdsoft.com On-Site Training in C/C++, Java, Perl and Unix C++ users: download BD Software's free STL Error Message Decryptor at: www.bdsoft.com/tools/stlfilt.html
- Next message: Andrey Tarasevich: "Re: template trick?"
- Previous message: Martin Dickopp: "Re: Maximum for Arrays in C/C++"
- In reply to: Claudio Puviani: "Re: where? heap or stack?"
- Next in thread: Claudio Puviani: "Re: where? heap or stack?"
- Reply: Claudio Puviani: "Re: where? heap or stack?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]