[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?
Dmitry
- Re: Proposal: block-based vector allocator, Dmitry Antipov, 2012/05/17
- Re: Proposal: block-based vector allocator, Stefan Monnier, 2012/05/18
- Re: Proposal: block-based vector allocator, Stefan Monnier, 2012/05/21
- Re: Proposal: block-based vector allocator, Dmitry Antipov, 2012/05/22
- Re: Proposal: block-based vector allocator, Dmitry Antipov, 2012/05/31
- Re: Proposal: block-based vector allocator, Paul Eggert, 2012/05/31
- Re: Proposal: block-based vector allocator, Stefan Monnier, 2012/05/31