* This patch implements a memory allocator to obtain memory for
structures whose last member is a variable length array. C99 refers
to these variable length objects as structs containing flexible
array members.
---
src/util/memory.c | 40
src/util/
On 04/05/2010 11:21 AM, David Allan wrote:
> +int virAllocVar(void *ptrptr, size_t struct_size, size_t element_size,
> size_t count)
Shouldn't that be void **ptrptr - that is, the caller passes in the
address of a void* that we then modify?
> +{
> +size_t alloc_size = 0;
> +
> +#if TEST_OOM
On Mon, Apr 05, 2010 at 11:51:48AM -0600, Eric Blake wrote:
> On 04/05/2010 11:21 AM, David Allan wrote:
> > +int virAllocVar(void *ptrptr, size_t struct_size, size_t element_size,
> > size_t count)
>
> Shouldn't that be void **ptrptr - that is, the caller passes in the
> address of a void* that
On 04/05/2010 01:51 PM, Eric Blake wrote:
On 04/05/2010 11:21 AM, David Allan wrote:
+int virAllocVar(void *ptrptr, size_t struct_size, size_t element_size, size_t
count)
Shouldn't that be void **ptrptr - that is, the caller passes in the
address of a void* that we then modify?
+{
+size
On 04/06/2010 06:59 AM, Dave Allan wrote:
>> Then again, fixing the type for your new method would imply fixing the
>> typing of virAlloc and friends as well.
Daniel's arguments are convincing; it's okay to keep the ugly cast in
the implementation if it makes the header easier to use without havin
On 04/07/2010 10:17 AM, Eric Blake wrote:
On 04/06/2010 06:59 AM, Dave Allan wrote:
Then again, fixing the type for your new method would imply fixing the
typing of virAlloc and friends as well.
Daniel's arguments are convincing; it's okay to keep the ugly cast in
the implementation if it make
On Wed, Apr 07, 2010 at 12:49:46PM -0400, Dave Allan wrote:
> On 04/07/2010 10:17 AM, Eric Blake wrote:
> >On 04/06/2010 06:59 AM, Dave Allan wrote:
> >>>Then again, fixing the type for your new method would imply fixing the
> >>>typing of virAlloc and friends as well.
> >
> >Daniel's arguments are
On Wed, Apr 14, 2010 at 01:31:15PM -0400, Dave Allan wrote:
> On Wed, Apr 07, 2010 at 12:49:46PM -0400, Dave Allan wrote:
> > On 04/07/2010 10:17 AM, Eric Blake wrote:
> > >On 04/06/2010 06:59 AM, Dave Allan wrote:
> > >>>Then again, fixing the type for your new method would imply fixing the
> > >>
On Wed, Apr 14, 2010 at 06:37:35PM +0100, Daniel P. Berrange wrote:
> On Wed, Apr 14, 2010 at 01:31:15PM -0400, Dave Allan wrote:
> > On Wed, Apr 07, 2010 at 12:49:46PM -0400, Dave Allan wrote:
> > > On 04/07/2010 10:17 AM, Eric Blake wrote:
> > > >On 04/06/2010 06:59 AM, Dave Allan wrote:
> > > >>