Forum > FPC development

TFileStream file size limit

<< < (2/8) > >>

Thaddy:
AFAIK Address space is limited to high(qword), at lot.., but single read/writes are limited to high(nativeint) which is indeed 2G
Note that in practise it limits to available memrory otherwise a EOutOfMemory is thrown.
Note that for 32 bit WIN there is a PE flag - since windows 7 - that extends available memory to 4G but still with the limitation ffor single read/writes

Thaddy:

--- Quote from: korba812 on October 04, 2021, 03:28:12 pm ---The result of "MaxLongint + 1" is Int64. Try "MaxLongint - 1".

--- End quote ---
In Freepascal simply use High(<type>);

marcov:

--- Quote from: Thaddy on October 04, 2021, 04:31:14 pm ---AFAIK Address space is limited to high(qword), at lot.., but single read/writes are limited to high(nativeint) which is indeed 2G

--- End quote ---

size_t does not need to cover the whole address space. If the kernel doesn't hand out such large consecutive blocks to applications, it is only a waste of bits.

Thaddy:
true. btw I should have written High(NativeInt). And that on 32 bit the flag for windows is IMAGE_FILE_LARGE_ADDRESS_AWARE. I don't know if you defined those consts in windows.pas.
See MSDN or https://docwiki.embarcadero.com/RADStudio/Alexandria/en/PE_(portable_executable)_header_flags_(Delphi)

The value of the flag is $20

marcov:
Image header structs and constants have been reworked one or two years ago.

Doesn't mean it will be perfect, but most should be there, including fairly recent stuff.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version