It is possible for allocations to exceed INT_MAX in size, most notably on most 64-bit C implementations. I think ptrdiff_t is the best signed type available for using this, but may be wrong.