> [Scott Gilbert] > > At the moment, the only 64 bit platform that I have easy access to is > > Tru64/Alpha. That version of malloc takes a size_t which is a 64 bit > > quantity. > > > > I believe most semi-sane platforms will use a size_t as argument for > > malloc, > [Tim] > That much is required by the C standard, so you can rely on it. > > > and I believe most semi-sane platforms will have a size_t that is > > the same number of bits as a pointer for that platform. > > The std is silent on this; it's true on 64-bit Linux and Win64, so "good > enough". > > >> Can you index these byte arrays by longs? > > > You could index it via a long, but using a LONG_LONG is safer. My > > understanding is that on Win64 a long will only be 32 bits even though > > void* is 64 bits. > > Right. So isn't the conclusion that sizeof(size_t) == sizeof(void *) on any platform, and so the index should be of type size_t instead of int, long, or LONG_LONG (aka __int64 in some places)? Thomas
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4