|
|
|
|
|
by jstimpfle
1292 days ago
|
|
This is hilarious. SIZE_MAX is at least as large as the largest string that you can put in your address space / memory anyway. Which is what the strlen() API already assumes. That, plus you'd be a fool to store a huge string in this way anywhere (in or out of memory) in any case. |
|
Not necessarily. A 64-bit system could give processes an address space that’s significantly larger than half the full 64-bit address space and have an allocator that allows you to allocate a block of more than SIZE_MAX bytes (malloc takes a size_t, but you can use calloc)