MemoryBlock Size

What happens if a Memory Block is larger than an Integer? Is it possible to get or change the size? Is it even possible to have a MB larger than an Integer?

larger than an integer?

How much do you need?

Well the code I’m porting has a max of UInt32 using Byte Array. It’s for encrypting large files. So I’m trying to figure out if I need to break large files up into pieces at (Max) Integer in length or if there’s a way to continue using UInt32 as chunks.

2 GB should be enough for that, right?

A 64bit app could process several terabytes if you have enough RAM.

You can proceed 2GB file for 32bit app and 838533.248 TB for 64bit app.

[quote=294898:@Christian Schmitz]2 GB should be enough for that, right?

A 64bit app could process several terabytes if you have enough RAM.[/quote]

But if there’s no way to get or set the size then I’ll need to do it in smaller chunks or go back to a byte array. A mb of UInt32 max is 4,294,967,295 bites but since Size is Integer that means max length would be half that.

Integer in 64-bit is 64-bit. So max size is much more.

Ahhh so in 64-bit App a memorybyte Size will go as high as 2^63-1 but in the 32-bit version it will top out at Int32. Good to know, thanks. As a side question does that mean an array will be able hold 2^63-1 elements as well? (just for knowledge, don’t see a use for it anything I’m doing)

If you find a CPU with so many address lines and enough RAM, than: yes.