Path: ...!feed.opticnetworks.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Chris M. Thomasson" Newsgroups: comp.lang.c Subject: Re: realloc() - frequency, conditions, or experiences about relocation? Date: Mon, 24 Jun 2024 18:31:48 -0700 Organization: A noiseless patient Spider Lines: 27 Message-ID: References: <875xtyu0kk.fsf@nosuchdomain.example.com> <87r0cmrpww.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 25 Jun 2024 03:31:49 +0200 (CEST) Injection-Info: dont-email.me; posting-host="a0475ea1831d78ec58c17d06517ed380"; logging-data="1284409"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CZ4XvHy799ZxGTFP8K4r7l6q2HdnLGPk=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:bDVihlfwqa151mtvzA+7WvkErx8= In-Reply-To: <87r0cmrpww.fsf@nosuchdomain.example.com> Content-Language: en-US Bytes: 2270 On 6/24/2024 2:28 PM, Keith Thompson wrote: > scott@slp53.sl.home (Scott Lurndal) writes: >> Malcolm McLean writes: > [...] >>> Baby X has bbx_malloc() which is guaranteed never to return NULL, and >>> never to return a pointer to an allocation which cannot be indexed by an >>> int. >> >> What do you mean by 'indexed by an int'? So, what happens if I index >> your allocation with -109235? >> >> Or did you mean to say unsigned (or positive) int less than the >> size of the allocation? > > If I recall correctly, Malcolm hates size_t. I presume that > bbx_malloc() will never allocate more than INT_MAX bytes. > He still has to deal with bbx_malloc failing. Don't like automatically aborting... bbx_malloc(INT_MAX); bbx_malloc(INT_MAX); bbx_malloc(INT_MAX); .... ;^)