Re: Memory Manager DLL Validation
- From: "John O'Harrow" <john@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Apr 2005 10:44:17 +0100
"Pierre le Riche" <pleriche@xxxxxxxxxxx> wrote in message
news:4264ca54@xxxxxxxxxxxxxxxxxxxxxxxxx
> Hi John,
>
>> I thought the rule finally agreed on was that it is allowed to write but
>> NOT modify any data beyond the last used character.
>
> How do you guarantee that the extra bytes you're writing is not modifying
> the data beyond the last used character? In a multi-threaded environment
> those bytes may change at any time, and unless you're going to resort to
> using "lock cmpxchg x, y" (which would kill performance) you'll never be
> safe.
>
> I propose that this rule be scrapped since it is not practical.
>
> IMO reading past the end is fine, but writing is not acceptable. Has
> anybody asked Borland's opinion on this? I'll bet they would also be
> against it.
>
> What if someone uses the Fastcode library together with their own MM or if
> they override NewInstance in a class and don't dword align the end?
Don't misunderstand me. I too, am against this rule.
In my opinion, we should never read or write beyond the null terminator
byte. I know Borland themselves do read beyond the null terminator (in
_LStrCmp), but I believe even that was an oversight. Unfortunately that
oversight means that AnsiStrings's must also be padded to a DWORD boundary
in any replacement Memory Manager.
regards,
John
.
- Follow-Ups:
- Re: Memory Manager DLL Validation
- From: Eric Grange
- Re: Memory Manager DLL Validation
- References:
- Memory Manager DLL Validation
- From: Robert Houdart
- Re: Memory Manager DLL Validation
- From: Pierre le Riche
- Re: Memory Manager DLL Validation
- From: Dennis
- Re: Memory Manager DLL Validation
- From: Pierre le Riche
- Re: Memory Manager DLL Validation
- From: Dennis
- Re: Memory Manager DLL Validation
- From: Pierre le Riche
- Re: Memory Manager DLL Validation
- From: Dennis
- Re: Memory Manager DLL Validation
- From: Pierre le Riche
- Re: Memory Manager DLL Validation
- From: John O'Harrow
- Re: Memory Manager DLL Validation
- From: Pierre le Riche
- Memory Manager DLL Validation
- Prev by Date: Re: Memory Manager DLL Validation
- Next by Date: Re: Memory Manager DLL Validation
- Previous by thread: Re: Memory Manager DLL Validation
- Next by thread: Re: Memory Manager DLL Validation
- Index(es):
Relevant Pages
|