Sujet : Re: avoiding strdup()
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 11. Mar 2024, 21:11:02
Autres entêtes
Organisation : None to speak of
Message-ID : <871q8ga5rd.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Spiros Bousbouras <
spibou@gmail.com> writes:
On Mon, 11 Mar 2024 10:13:12 -0700
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
One data point: On my Ubuntu system, malloc(SIZE_MAX) returns NULL for
very large arguments (over about 23 GiB in my quick and dirty test).
>
You lost me there.
Sorry, editing error. I initially tried malloc(SIZE_MAX) and got a NULL
result. I then tried smaller values to try to find out where the cutoff
is, and didn't correctly edit the post.
Corrected version:
One data point: On my Ubuntu system, malloc() returns NULL for
very large arguments (over about 23 GiB in my quick and dirty test).
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comWorking, but not speaking, for Medtronicvoid Void(void) { Void(); } /* The recursive call of the void */