On 26/10/2026 21:29, Chris M. Thomasson wrote:
> On 10/25/2026 8:40 PM, Lawrence D’Oliveiro wrote:
>> On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:
>>
>>> Managing the memory is the caller’s job in C anyway.
>>
>> Does that apply to the caller of library APIs like malloc(3) and
>> free(3)?
>
> Yes. The caller calls malloc, if it succeeded, the caller needs to free what it got... Right?
Exactly. The caller is responsible for /managing/ the memory (or it can pass on that responsibility to something else). malloc and free are provide and dispose of memory, they do not manage it.