Re: git: 2c709ee70ade - main - libc: handle zero alignment in memalign()
Date: Sat, 25 Feb 2023 01:27:36 UTC
Ed Maste wrote in <CAPyFy2D3T6AtK-TYU2HZ9R8QvemC+_2pZ52vqANoPOtHhnyuiw@mail.gmail.com>: |On Fri, 24 Feb 2023 at 18:26, Steffen Nurpmeso <steffen@sdaoden.eu> wrote: ... |> Just out of interest. Why not 1? |> Or "if(align==0)align=1;"? | |Yes that's what I would have done, but it's fine either way and I just |took the submission. | |> (Which is what i always did, as> "allocating nothing" is merely \ |> a debug concern, which, for better |> memory pools like OpenBSD (i would presume), or during ASAN, |> causes better (even upon read).) | |I don't really understand what you mean here, or how "allocating |nothing" is related. Me too. 'Was just thinking of allocators which give back valid but inaccessible memory for 0 bytes so that each access would fault. (As opposed to give back minimum allocation. Or give back minimum allocation but in debug mode "put canaries" so that write accesses "are detected", but read ones not. That mediocre stuff that i was and am doing thus. Whatever.) Thanks, and a nice weekend. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)