stream.getc() doesn't recognize eof
    Brian White 
    bcwhite at pobox.com
       
    Sun Mar 16 14:43:56 PDT 2008
    
    
  
>>>         (result == 0 && memcmp(buffer_in, buffer, size) == 0));
>>
>> Eee-Gad, but that's painful!  Performance could easily be so bad that 
>> I'd turn off the checks and then they're no use at all.
> 
> You can use -release to turn off contracts and asserts, so only 
> non-release builds would suffer the penalty.
My worry is that the test code would be such a performance hit that it 
would be impossible to use without -release.
>> I've never known a "read" function to modify bytes beyond the "count" 
>> amount returned, but I don't know if it's ever explicitly stated not 
>> to do so.
> 
> True.  You could perhaps cheat a little and remember just the first byte 
> of the output buffer, chances are if the first byte hasn't changed, 
> nothing was written to the buffer.
I was just thinking the exact same thing.
-- Brian
    
    
More information about the Digitalmars-d-learn
mailing list