Treating the abusive unsigned syndrome

Kagamin spam at here.lot
Fri Nov 28 02:22:04 PST 2008


Andrei Alexandrescu Wrote:

> Often large integers hold counts or sizes of objects fitting in computer 
> memory.

Yes, if that object is system-specific like size of allocated heap chunk. Business objects don't seem to respect system constraints (they are nearly storage-agnostic). Files are the good example.

> There is a sense of completeness of a systems-level language in 
> being able to use a native type to express any offset in memory. That's 
> why it would be some of a bummer if we defined size_t as int on 32-bit 
> systems: I, at least, would feel like giving something up.

Yes, giving somethink up always feels like giving something up. But can you rely on large numbers? I heard a story about program crash on attempt to allocate memory chunk larger than half address space. It was intended to be valid since there was enough address space, it turned out that one dll happened to be relocated at the middle of address space, so there was no continuous mem chunk of requested size.



More information about the Digitalmars-d mailing list