using off_t in talloc

Stefan (metze) Metzmacher metze at samba.org
Wed Jul 26 12:53:32 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

tridge at samba.org schrieb:
> Metze,
> 
> size_t is not guaranteed to be big enough to hold the sum of all
> memory allocations in a program, and its also not guaranteed to be big
> enough to hold the total count of memory allocations. It is only
> guaranteed to be big enough to hold a single object. Back in the days
> of DOS and small/large/huge memory models, it would have been quite
> possible for size_t to be 16 bit, while off_t was 32 bit or even 64
> bit. And you could certainly have a lot more memory allocated than
> 2^16 bytes.

I added a configure check that bails out,

if sizeof(size_t) < sizeof(void *), which made sure that
a size_t value can represent each possible memory offset
from 0 to the largest addressable byte.

and that works fine on any host in the build-farm.

And it someone reports this as a failure we can rethink about this.

metze
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFEx2XMm70gjA5TCD8RAu4aAKCIN9cGtK18N/0ef/ySNpnNSPXgigCgz/4B
j2L0ZxmOECRa2GeUwDU5Wuo=
=XQYc
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list