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

64bit sized bigarrays support #8733

Closed
XVilka opened this issue Jun 13, 2019 · 7 comments
Closed

64bit sized bigarrays support #8733

XVilka opened this issue Jun 13, 2019 · 7 comments

Comments

@XVilka
Copy link
Contributor

XVilka commented Jun 13, 2019

One of the good example is to use Bigarray mapped on top of the file, whose size can easily exceed the 32bit limits. It would be really useful in 2019 to have bigger bigarrays.

@nojb
Copy link
Contributor

nojb commented Jun 13, 2019

One of the good example is to use Bigarray mapped on top of the file, whose size can easily exceed the 32bit limits. It would be really useful in 2019 to have bigger bigarrays.

Which limit is this? I thought bigarrays did not have any hard-coded limit.

@XVilka
Copy link
Contributor Author

XVilka commented Jun 13, 2019

@nojb for example Bigarray.Array1.get ba offset requires offset to be int, rather than int64, obviously limiting the size to 32bits.

@dbuenzli
Copy link
Contributor

obviously limiting the size to 32bits.

To 30 bits to be precise. But then on a 32-bit machine addressing is limited to 32-bits anyways.

If you want to use large files on 32-bit machines you should use Unix.Largefile rather than mmaping them. Depending on the size of your platform's off_t type this may allow you to deal with files larger than what 30-bits allow.

@XVilka
Copy link
Contributor Author

XVilka commented Jun 13, 2019

@dbuenzli well, I talk more about 64bit machines, since 32bit are quite rare these days.

P.S. Yes, of course 30 bits, you are right.

@nojb
Copy link
Contributor

nojb commented Jun 13, 2019

@dbuenzli well, I talk more about 64bit machines, since 32bit are quite rare these days.

An int in a 64bit machine is 63 bits wide, so it limits you to 62 bits of addressable memory. This is surely enough, right?

@dbuenzli
Copy link
Contributor

Well but your indexing ints on a 64-bit machine are 62-bit then which should be sufficient for most needs.

@XVilka
Copy link
Contributor Author

XVilka commented Jun 13, 2019

Oh, I misunderstood then. Thanks for the answers, closing this one.

@XVilka XVilka closed this as completed Jun 13, 2019
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

3 participants