Re: [RFC] solution for the inet_ntoa problem, buffer allocator

From: Frank van Maarseveen (F.vanMaarseveen@inter.NL.net)
Date: Wed Jul 05 2000 - 15:07:16 EST


On Wed, Jul 05, 2000 at 02:08:49PM +0200, Olaf Titz wrote:
> The buffer allocation works as follows: every conversion routine has
> its own chain (salloc_t) of buffers (scope_buf_t). Whenever a buffer
> is needed, it looks for a free one in the chain. Each buffer is tagged
> with the return address of the caller (here called "scope"). A buffer
Very clever. But probably too fragile for various reasons. A ring of
say 30 buffers might be less fragile and simpler.

As others have pointed out a new format specifier would be the best
solution. Extending gcc function attributes for checking the format
string would be necessary. IMHO the time is right to push this into
egcs/gcc, at least for IPv6 addresses.

It can all be done (also for IPv4) such, that a ring buffer fallback
for earlier gcc versions would handle the current situation with the
many gcc versions out there gracefully.

-- 
Frank

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:17 EST