Author larry
Recipients
Date 2007-01-14.11:44:50
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Here's another possible fix for the worst-case scenario:

#define MAX_SLICE_DELTA (64*1024)
if ( ((size_of_slice + MAX_SLICE_DELTA) > size_of_original) 
    || (size_of_slice > (size_of_original / 2))  )
    use_lazy_slice();
else
    create_string_as_normal();

You'd still get the full benefit of lazy slices most of the time, but it takes the edge off the really pathological cases.

How's that?
History
Date User Action Args
2007-08-23 15:56:04adminlinkissue1629305 messages
2007-08-23 15:56:04admincreate