Re: memory leak in <vector> STL
From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 07/20/04
- Previous message: tom_usenet: "Re: memory leak in <vector> STL"
- In reply to: tom_usenet: "Re: memory leak in <vector> STL"
- Next in thread: Bo Persson: "Re: memory leak in <vector> STL"
- Reply: Bo Persson: "Re: memory leak in <vector> STL"
- Reply: Igor Tandetnik: "Re: memory leak in <vector> STL"
- Reply: Stephen Howe: "Re: memory leak in <vector> STL"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 20 Jul 2004 13:42:37 -0400
"tom_usenet" <tom_usenet@hotmail.com> wrote in message
news:6okqf0d378ifu91jpo912rcg3kv36qosc0@4ax.com
> On Tue, 20 Jul 2004 12:55:27 -0400, "Igor Tandetnik"
> <itandetnik@mvps.org> wrote:
>
>> Some of the messages you referred me to seem to claim that x86 is
>> one of the "abnormal" platforms - that on x86 in protected mode,
>> loading an invalid address into registers can actually cause CPU to
>> trip a hardware fault. I don't really know what I'm talking about
>> here, just parroting back what I read in the post. Please correct me
>> if I'm wrong or (likely) simply misunderstand the claim.
>
> I believe that you only have a problem on x86 if you dereference the
> pointer - the compiler won't generate the problematic code unless it
> sees a * or ->. I don't know much about registers and assembler either
> though!
Specifically, I'm referring to
http://www.google.co.uk/groups?selm=j4d7483ask.fsf%40informatik.hu-berlin.de
saying "People bring up x86 as an example, where a segment register load
causes a failure if the segment descriptor has been invalidated." Then
again, as far as I know, Win32 uses flat memory model where all segment
registers are 0 at all times, so maybe this is irrelevant to our
architecture of choice after all.
> You need a version of remove_if that deletes each removed element
> after copying over it. This may do it in O(n):
Right, one can do this. It would require a hand-rolled remove()
implementation though - the stock std::remove_if() is not guaranteed to
behave this way.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
- Previous message: tom_usenet: "Re: memory leak in <vector> STL"
- In reply to: tom_usenet: "Re: memory leak in <vector> STL"
- Next in thread: Bo Persson: "Re: memory leak in <vector> STL"
- Reply: Bo Persson: "Re: memory leak in <vector> STL"
- Reply: Igor Tandetnik: "Re: memory leak in <vector> STL"
- Reply: Stephen Howe: "Re: memory leak in <vector> STL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|