Subject: Re: new mbuf API
To: Pavel Cahyna <pavel@netbsd.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: tech-net
Date: 04/20/2007 13:54:33
Pavel Cahyna <pavel@netbsd.org> writes:

> On Fri, Apr 20, 2007 at 01:40:16PM -0400, Greg Troxel wrote:
>>   What I've missed there was a description of "guaranteed contiguous
>>   data". The problem is that one function can make part of the mbuf chanin
>>   contiguous (like m_pulldown or one of the new functions), but a
>>   subsequent call can fragment the chain again. To prevent this, I have
>>   introduced the notion of "guaranteed contiguous data". If a function
>>   makes a range of a mbuf chain contiguous, it also marks it as a
>>   guaranteed contiguous region and subsequent calls to mbuf rearranging
>>   functions must keep it contiguous.
>> 
>> If it's not safe for a caller to assume it's still true, then the word
>> guaranteed shouldn't be used.  What you're describing is more like an
>> efficiency hint.  This also seems complicated, and if a caller can't
>> safely omit checks, I'm not sure how much is gained.
>
> The purpose is exactly to be able to omit checks.

Then you have to specify very carefully under what circumstances the
checks can be omitted; you said that the "guarantee" couldn't always be
honored.