Re: [PATCH] Choose syntax



Hi Pavel,

On Tue, 2005-07-12 at 13:28, Pavel Tsekov wrote:
> How about informing the caller how much memory should be allocated ? The
> caller passes a pointer to integer, which is filled with the number of slots
> it allocated, to the callee. The callee finds out that the slots are not
> enough, calculates how much slots should be allocated and passes the value
> through the integer pointer back to the caller. The caller then allocates
> as many slot as are necessary and repeats the call.

To me this looks like a complicated approach. The cleanest approach
would be to allocate the list dynamically while it's being constructed.
As indicated I had some problems with the pointer arithmetic though.

I might try to implement a dynamic allocation at a later point, but as I
pointed out, if we decide to save the list the static size of the list
is not that much of a problem anyway.

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research





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