Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaxInt is non-platform-adjustable, example: Array indexes limited to 32 bits shr 4 #17

Open
SkybuckFlying opened this issue Aug 27, 2022 · 0 comments

Comments

@SkybuckFlying
Copy link

Examples of code:

I am not sure if this is an actual limitation. Since maybe these arrays allocated dynamically.

I am currently busy trying to declare an array type, purely for debugging purposes.

A typed pointer only cannot be debugged easily in the way of an array, so I was hoping that GLScene would give a nice example of how to declare it but then I ran into this and discovered this potential limitation.

I am not sure what the real/current limitation is of arrays in Delphi 10.3.2, which is what I am using.

Anyway, perhaps this is something that should be looked into.

I at least looked into MaxInt and it says 2 billion on win32 and win64 platform and the latter is maybe incorrect and a problem.

const
cMaxArray = (MaxInt shr 4);

(* Types to specify continous streams of a specific type
switch off range checking to access values beyond the limits *)
PByteVector = ^TByteVector;
PByteArray = PByteVector;
TByteVector = array [0 .. cMaxArray] of Byte;

PWordVector = ^TWordVector;
TWordVector = array [0 .. cMaxArray] of Word;

PIntegerVector = ^TIntegerVector;
PIntegerArray = PIntegerVector;
TIntegerVector = array [0 .. cMaxArray] of Integer;

PFloatVector = ^TFloatVector;
PFloatArray = PFloatVector;
PSingleArray = PFloatArray;
TFloatVector = array [0 .. cMaxArray] of Single;
TSingleArray = array of Single;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant