summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/socket.c
diff options
context:
space:
mode:
authorGabriel Scherer <gabriel.scherer@gmail.com>2012-07-10 09:58:38 +0000
committerGabriel Scherer <gabriel.scherer@gmail.com>2012-07-10 09:58:38 +0000
commitbc139ae14e8d772b73e039e8a236eff714b5b3f6 (patch)
tree452f3726f82717ce360db6f84be9734e9a37c976 /otherlibs/win32unix/socket.c
parent43c7d1b51c6fb3a91b9729b816630f536d4a60e2 (diff)
PR#5644: Stream.count broken when used with Sapp or Slazy nodes
There is a bug in the way concatenating operations work when combined with `Sgen`-defined stream (Stream.from, Stream.of_string): the concatenation functions reset the `count` field to 0, which disturbs the Sgen producer. While the fix in the Scons case is easy (instead of 0, set the count to `original_count - 1`), fixing the Sapp case is more delicate (we can't predict the size of the prepended stream). Our technique is to change the stored left-hand-side to not the stream data only, but the whole stream, count included. Once we detect the prepended stream was completely consumed, we can then restore the count to its previous value, so that Sgen's function can be provided correct count information. This required a change in the internal `get_data` implementation. Slazy-constructed streams have the exact same issue: we don't know their count before forcin them. Again, `get_data` is changed to dynamically update the count at forcing time. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12682 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/win32unix/socket.c')
0 files changed, 0 insertions, 0 deletions