digitalmars.D - [unsigned] No, you can't address full address space in D
- Kagamin (1/1) Feb 20 2016 It doesn't even compile: http://dpaste.dzfl.pl/ec0f5183e42e
- Chris Wright (12/13) Feb 20 2016 Check the error. Add a `cast(size_t)` in there. Try again.
- Steven Schveighoffer (4/9) Feb 20 2016 Let's not forget that you need 18 exabytes of ram too. And you
- Chris Wright (4/13) Feb 20 2016 Point. The GC uses calloc, which does happen to complain when I ask for
- rsw0x (7/8) Feb 20 2016 This looks like it's a limit purely on the interface for
It doesn't even compile: http://dpaste.dzfl.pl/ec0f5183e42e
Feb 20 2016
On Sat, 20 Feb 2016 17:04:11 +0000, Kagamin wrote:It doesn't even compile: http://dpaste.dzfl.pl/ec0f5183e42eCheck the error. Add a `cast(size_t)` in there. Try again. That's still doomed to failure. You're not leaving space for the stack (which has preallocated address space) or application binary (which is memory mapped from the file and takes up address space). You're using the garbage collector, which has to allocate its own internal data structures somewhere. If you subtract those from your allocation request, you still won't see much success. There's no guarantee where in memory those items will be allocated, and if your system has ASLR turned on by default, it's even less predictable. If you tried a similar thing in C, you'd see the same problems.
Feb 20 2016
On Saturday, 20 February 2016 at 17:21:42 UTC, Chris Wright wrote:That's still doomed to failure. You're not leaving space for the stack (which has preallocated address space) or application binary (which is memory mapped from the file and takes up address space). You're using the garbage collector, which has to allocate its own internal data structures somewhere.Let's not forget that you need 18 exabytes of ram too. And you want it initialized? That's going to take a while ;) -Steve
Feb 20 2016
On Sat, 20 Feb 2016 18:07:59 +0000, Steven Schveighoffer wrote:On Saturday, 20 February 2016 at 17:21:42 UTC, Chris Wright wrote:Point. The GC uses calloc, which does happen to complain when I ask for vast amounts of memory. There are other ways of requesting address space, though, such as mmap(2).That's still doomed to failure. You're not leaving space for the stack (which has preallocated address space) or application binary (which is memory mapped from the file and takes up address space). You're using the garbage collector, which has to allocate its own internal data structures somewhere.Let's not forget that you need 18 exabytes of ram too.
Feb 20 2016
On Saturday, 20 February 2016 at 17:04:11 UTC, Kagamin wrote:It doesn't even compile: http://dpaste.dzfl.pl/ec0f5183e42eThis looks like it's a limit purely on the interface for allocating arrays from the GC. i.e, ubyte* ptr; ubyte arr = ptr[0 .. size_t.max]; compiles just fine
Feb 20 2016