On Fri, 2012-08-17 at 14:41 +0200, David Henningsson wrote: > On 08/17/2012 02:39 PM, Tanu Kaskinen wrote: > > On Fri, 2012-08-17 at 13:36 +0200, David Henningsson wrote: > >> On 08/17/2012 01:30 PM, Tanu Kaskinen wrote: > >>> The buffers in question should be properly aligned for any > >>> integer size, so the warnings are false positives. > >> > >> Oh, so there were that many of them. Well, how about > >> > >> static inline void* pa_memblock_acquire_index(memblock, index) > >> { > >> return (void *) ((uint8_t *) pa_memblock_acquire(memblock) + index); > >> } > >> > >> ? > > > > A very good idea. What would you think about having > > pa_memchunk_acquire() instead? Almost all, if not all, instances where > > this pattern is used, the parameters to pa_memblock_acquire_index() > > would be "chunk->memblock, chunk->index", so it would be simpler to just > > pass a chunk pointer. > > Sounds good to me, assuming you are correct in that all memblocks > acquired are memchunks (which I haven't verified). I did not say that all pa_memblock_acquire() calls would be for memchunks, I said that (almost?) all pa_memblock_acquire_index() calls would be memchunks. Is that a problem? The purpose wouldn't be to replace pa_memblock_acquire(), the purpose would be to replace the pa_memblock_acquire_index() helper. -- Tanu