Re: [PATCH] compat: let git_mmap use malloc(3) directly

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

 



On Sat, Aug 21, 2021 at 02:52:40PM +0200, René Scharfe wrote:

> xmalloc() dies on error, allows zero-sized allocations and enforces
> GIT_ALLOC_LIMIT for testing.  Our mmap replacement doesn't need any of
> that.  Let's cut out the wrapper, reject zero-sized requests as required
> by POSIX and use malloc(3) directly.  Allocation errors were needlessly
> handled by git_mmap() before; this code becomes reachable now.

Thanks, this is a good idea. As you note, the function was already
expecting a possible NULL return. And I think in general it's good for
our compat/ wrappers to stay as close to the OS-level functions they're
emulating as possible.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux