[Top][All Lists]

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

Re: Proposal: block-based vector allocator

From: Dmitry Antipov
Subject: Re: Proposal: block-based vector allocator
Date: Mon, 21 May 2012 17:48:16 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

On 05/21/2012 05:02 PM, Andreas Schwab wrote:

It doesn't make much sense to try to find such a trivial but non-std
macro in a system header.

Hm, glibc provides some not-so-trivial bits (assuming gcc):

# define roundup(x, y)  (__builtin_constant_p (y) && powerof2 (y)             \
                         ? (((x) + (y) - 1) & ~((y) - 1))                     \
                         : ((((x) + ((y) - 1)) / (y)) * (y)))

It seems to be a very negligible optimization, but why not use it if available?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]