Re: [PATCH] malloc: return ZERO_SIZE_PTR for 0-byte allocations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 13 Mar 2025 09:56:58 +0100, Ahmad Fatoum wrote:
> Linux kmalloc doesn't return NULL on 0-byte allocations, but returns a
> fixed ZERO_PSIZE_PTR constant, which triggers a NULL page exception when
> dereferenced.
> 
> However, in barebox, allocator behavior differs:
> 
>  - glibc returns an unique pointer, but the standard also allows
>    libc implementations to return NULL
>  - tlsf returns NULL
>  - dlmalloc returns a unique pointer
>  - dummy malloc returns a unique pointer
> 
> [...]

Applied, thanks!

[1/1] malloc: return ZERO_SIZE_PTR for 0-byte allocations
      https://git.pengutronix.de/cgit/barebox/commit/?id=3f5b270289be (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux