Board index » delphi » Re: Fastcode Voting - 3GB Memory Space

Re: Fastcode Voting - 3GB Memory Space


2005-09-16 03:13:53 PM
delphi74
Hi
I like that one too.
Could somebody update our list?
Best regards
Dennis
 
 

Re: Fastcode Voting - 3GB Memory Space

Dennis writes:
Quote
Hi

Should we make this rule?

1) A function may not assume that the high bit of a pointer is 0.
yes
Quote
2) Functions have to be compatible with an address space larger than 2GB?
(LARGE_ADDRESS_AWARE PE Flag)
if it correctly recognizes it and throws an appropriate error: no.
--
Hannes Danzl [NexusDB Developer]
Newsgroup archive at www.tamaracka.com/search.htm
 

Re: Fastcode Voting - 3GB Memory Space

"Eric Grange" <XXXX@XXXXX.COM>writes
Quote
>1) A function may not assume that the high bit of a pointer is 0.
Basicly means hunting for Integer() casts in the code
Why?
A := Integer($F1234567) works fine.
*Comparing* (>, <) integer variables that have been assigned from pointers
is another, matter though.
 

Re: Fastcode Voting - 3GB Memory Space

Quote
Why?
Integer(SomePointer) are places where you're bound to encounter
the signed pointer arithmetic.
Quote
A := Integer($F1234567) works fine.
It works, but that is beside the point, as it is unnecessary enough
of a construct to be rare enough in anyone's code, and thus a rare
and easily dealt with false positive.
The rationale is that Integer() on the other hand will be almost
exclusively found for pointer/object casts to perform pointer
arithmetic in Pascal.
Quote
*Comparing* (>, <) integer variables that have been assigned from
pointers is another, matter though.
To assign a pointer to an integer variable, you will usually encounter
first an Integer() or a PInteger(), if you eliminate all conversions
of pointers to (signed) integer, then you will eliminate pretty much
all pascal-based signed pointer arithmetic (incl. comparisons).
Eric
 

Re: Fastcode Voting - 3GB Memory Space

Current results:
1) A function may not assume that the high bit of a pointer is 0.
2 votes: Florent, Hannes
2) Functions have to be compatible with an address space larger than
2GB (LARGE_ADDRESS_AWARE PE Flag)
2 votes: Eric, Hp
3) No rule.
No votes
4) Functions must be compatible with an address space larger than
2GB, and therefore it cannot be assumed that the high bit of a
pointer is 0.
3 votes: Avatar, Dennis, Pierre
 

Re: Fastcode Voting - 3GB Memory Space

Hi All
I would like to close this voting today.
Could those of you who voted before 4) was suggested, reconsider your vote.
Could I have more votes?
Best regards
Dennis
 

Re: Fastcode Voting - 3GB Memory Space

No 4 has been decided
Best regards
Dennis