Re:How to find size of an array in C without sizeof
by loeg on Monday December 26, 2016 @11:10PM
(#13261229)
It's basically bogus to have a single object bigger or equal to half of address space (represented by size_t) in C. 32-bit platforms should detect and abort in such conditions (compiler/linker for static objects, malloc() implementation for dynamic allocations).
[ Parent
| on HN ]
Re:How to find size of an array in C without sizeof
by icebraining on Tuesday December 27, 2016 @05:30AM
(#13262383)
Why? If you're running a system with PAE, half of a 32-bit address space is a small fraction of the whole addressable memory.
Re:How to find size of an array in C without sizeof
by loeg on Tuesday December 27, 2016 @01:21PM
(#13264838)
It's either addressable or it isn't. My understanding of typical PAE systems is that userspace is still limited to 32 bits of address space per process. Any system where userspace is not limited to 32 bits should have a larger than 32-bit size_t. (PAE systems are not true 32-bit platforms.)