Re: cvs commit: src/lib/libc/sys tls.2

看板DFBSD_commit作者時間21年前 (2005/03/22 06:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串15/20 (看更多)
The poin is, guys, that sizeof(some_ridiculously_large_structure_or_array_ which_is_as_large_as_the_processes_entire_address_space) is just plain ridiculous, and sizeof() should not have been made to return size_t for something so silly. They could have added a usizeof() for the one in a million chance that someone actually needed something like that, but no... the idiots on the standard committee seem to believe that sizeof() is only EVER used in calls to read() or write(), verses, say, in generic exprssions that might, say, calculate an array index. for (i = 0; i < sizeof(ary)/sizeof(ary[0]); ++i) ... now, should i be unsigned here, or an int? it should be an int, plain and simple, for 99.99999% of the programs ever written. For the same reason, a TLS segment that is the size of the entire address space (or even 1/2 the entire address space), is also ridiculous. -Matt Matthew Dillon <dillon@backplane.com>
文章代碼(AID): #12FqGd00 (DFBSD_commit)
討論串 (同標題文章)
文章代碼(AID): #12FqGd00 (DFBSD_commit)