This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/4] Add a signal-safe malloc replacement


On Thu, Dec 19, 2013 at 10:29 AM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:

> Attached patch committed as obvious.

And I've got power of 2 check wrong :-(

Fixed.
-- 
Paul Pluzhnikov

--- a/elf/dl-misc.c
+++ b/elf/dl-misc.c
@@ -396,7 +396,7 @@ __signal_safe_memalign (size_t boundary, size_t size)
     boundary = sizeof (*header);

   /* Boundary must be a power of two.  */
-  if ((boundary & (boundary - 1)) == 0)
+  if (!powerof2 (boundary))
     return NULL;

   size_t pg = GLRO (dl_pagesize);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]