[interfacekit] Re: BMallocIO broken

On 2002-10-06 at 20:24:29 [+0200], you wrote:

>    Looking at the code for BMallocIO, it looks like it's resizing on a
> Write() even if the new calculated size (ie position + bytes written)
> is *less* blocks than are currently allocated.  

Hm... it should not...

=09size_t newSize =3D max(pos + size, static_cast<off_t>(fLength));
=09status_t error =3D B_OK;

=09if (newSize > fMallocSize)
=09=09error =3D SetSize(newSize);

See? It resizes JUST if the newSize is more than the current allocated 
memory.
Anyway, the behaviour of my MallocIO implementation is very strange when 
used with the storage kit tests. I am looking into it.


Other related posts: