Re:Night of a cascading failure
by marcosdumay on Tuesday January 22, 2019 @08:04AM
(#18967932)
Size_t is guaranteed to hold values up to 65535. That's twice as long as int and much smaller than long.
[ Parent
| on HN ]
size_t is guaranteed to hold values large enough to index into any array you can allocate. On a 64-bit system with an allocator that supports allocations larger than 4GB, that means size_t has to be larger than 32 bits. If it's an LLP64 system, size_t will be larger than long. If the value represents an index or size of something in memory, use size_t. Consider ssize_t if you need negative values and are certain you never need the larger half of the size_t range.