Follow-up Comment #26, patch #5360 (project mldonkey):
Unfortunately I don't see how you can be "pretty sure the results are real",
nor how it can be a workaround.
stdlib/buffer.ml
let resize b more =
let len = b.length in
let new_len = ref len in
while b.position + more > !new_len do new_len := 2 * !new_len done;
if !new_len > Sys.max_string_length then begin
if b.position + more <= Sys.max_string_length
then new_len := Sys.max_string_length
else failwith "Buffer.add: cannot grow buffer"
end;
let new_buffer = String.create !new_len in
String.blit b.buffer 0 new_buffer 0 b.position;
b.buffer <- new_buffer;
b.length <- !new_len
As you can see, a buffer will fail to grow ONLY if it exceeds
Sys.max_string_length. That is the *only* way it can fail.
If you initialize the buffer to 1, 150, 150305 or 3949392, it will double in
size each resize until it exceeds Sys.max_string_length. That is not what I
feel, nor what I guess is happening, nor the impression I get after using
mldonkey for a week or two. It is what the cold hard code says that it is
doing! :-)
The larger point that I am trying to make is that some code might be going
into CVS that doesn't make any logical sense.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?5360>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
_______________________________________________
Mldonkey-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/mldonkey-users