Commit Graph

45 Commits (bdd9ca391e3a56253d7480b07bb1a8aac361904c)

Author SHA1 Message Date
Gabriel Scherer f138e1be40 buffer: more detailed explanation of the [resize] reasoning 2019-04-16 17:29:26 +02:00
Gabriel Scherer 52a5c3fae8 refine the [resize] post-condition
See https://github.com/ocaml/ocaml/pull/8596#issuecomment-480812433
2019-04-16 10:05:54 +02:00
Gabriel Scherer 91daa22489 Buffer: actually enforce the invariant that (b.position <= b.length)
See https://github.com/ocaml/ocaml/pull/8596#issuecomment-480760172
and the rest of the conversation.
2019-04-16 10:05:54 +02:00
Gabriel Scherer b4cda227ae clarify the add_channel logic 2019-04-16 10:05:54 +02:00
Damien Doligez 4e59ae10dd add assertion and comments suggested by @gasche 2019-04-08 14:16:26 +02:00
Damien Doligez ee1c8b4082 optimize more functions 2019-04-08 11:47:43 +02:00
Damien Doligez 2085db3c3c #6148: optimize some buffer operations 2019-04-08 11:10:39 +02:00
Alain Frisch 1ec0ece0ab
Extend Bytes and Buffer with functions to read/write binary representations of numbers (#1864) 2018-11-09 13:40:33 +01:00
Daniel Bünzli acb0e91ac6 Stdlib doc: harmonize heading levels again. (#2142) 2018-11-08 17:33:55 +01:00
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00
Simon Cruanes df80f34a92 Stdlib functional iterators (#1002)
* add `Seq` module, expose iterator conversions in most containers

* small typo

* typo

* change order of arguments for `{Map,Set}.add_seq`

* watch for max string length in `Bytes.of_seq`

* wip: make it build again

* Fix dependency

Sys needs to be linked before Bytes in stdlib.

* Update threads/stdlib.ml

* Update stdlib_no_prefixed/.depend

* fix inconsistencies with label modules

* update testsuite to work with seq

* update change file

* small change in `Hashtbl.to_seq`, capturing only the underlying array

* add some documentation to seq.mli

* revert to good ol' module type names for hashtables

* fix test

* change style of comments in seq.mli

* follow some demands in review of GPR #1002

* some fixes for #1002

* add Seq-related functions to Ephemeron

* add some comments on `Hashtbl.of_seq`

* add more tests for `Hashtbl.{to,of}_seq`

* fix bug in `Ephemeron.to_seq`

* Update Changes
2018-03-16 18:25:10 +01:00
Daniel Bünzli e0751d932e Add Buffer.add_utf_{8,16be,16le}_uchar and Uchar.{bom,rep} (#1091) 2017-03-16 08:28:11 +00:00
Dhruv Makwana d5af984970 Add MPR#6975: truncate in Buffer module (#902)
MPR#6975: add truncate in Buffer module
2016-11-17 07:00:48 -05:00
yallop 8dea301503 Fix broken bounds check in Buffer.add_substring (#814)
* Fix the bounds check in Buffer.add_substring to handle overflow correctly.

* Changes entry for Buffer.add_substring bounds check fix.
2016-09-16 10:23:55 +02:00
Damien Doligez 520fb2df50 Merge tag 4.03.0 into trunk. 2016-04-28 16:13:21 +02:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Gabriel Scherer 543bc99a94 PR#6719: improve Buffer.add_channel when not enough input is available
When Buffer.add_channel fails with [End_of_input] because not enough
characters are available, the insufficiently-many characters that were
read are still kept in the buffer.

(Simon Cruanes)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16006 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-12 11:10:17 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Gabriel Scherer c6d67e2bf9 remove redundant bound checking in Buffer.blit (patch by Philippe Wang)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15073 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-08 15:57:22 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Alain Frisch bbb30a93b2 PR#6148: speed improvement for Buffer (patch by John Whitington).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14048 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-30 13:12:47 +00:00
Damien Doligez c92ab2768b remove non-ascii chars
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13030 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-17 21:01:38 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Xavier Leroy 8f0185c58d PR#5004: overflow in Buffer.add_channel
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10216 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-03-28 08:16:45 +00:00
Damien Doligez bdc0fadee2 merge changes from release/3.11.1 to release/3.11.2
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9540 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-01-20 16:26:46 +00:00
Pierre Weis b1d6d4faa3 Correction bug add_substitute.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9012 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2008-09-09 08:50:39 +00:00
Damien Doligez 0e5ca9dca5 nettoyage
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7164 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2005-10-25 18:34:07 +00:00
Pierre Weis ae6c474d49 Documentation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6406 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-06-14 20:20:16 +00:00
Basile Starynkevitch bfe541d754 added cvs Id
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6204 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-04-14 11:37:53 +00:00
Basile Starynkevitch 4281c5216b added Buffer.sub & Buffer.nth
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6203 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-04-14 11:26:21 +00:00
Pierre Weis 0df4ab0392 Documentation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5567 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-05-14 17:52:40 +00:00
Pierre Weis e9cda5216b Addition of function add_substitute for adding strings to buffer with
variable names substitution via a function mapping.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-04-28 08:13:20 +00:00
Xavier Leroy ede12e6163 Remplacement des tests ofs + len > length par ofs > len - length, pour eviter le debordement lors de l'addition (PR#1229)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4993 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-07-12 09:47:54 +00:00
Xavier Leroy 09581ecdf9 Guard against string length overflow when resizing (PR#1015)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4571 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-03-29 14:24:22 +00:00
Xavier Leroy 7501784c80 MAJ en-tetes pour mentionner la 'special exception' sur la LGPL
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4144 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-12-07 13:41:02 +00:00
Xavier Leroy 3e9b77d362 Micro-optimisation de Buffer.create
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3933 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-10-28 14:20:27 +00:00
Xavier Leroy cc0f32b054 Changement de la licence
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-17 18:59:06 +00:00
Damien Doligez 10270afb11 array.mli: documentation des cas d'erreur de make, make_matrix
string.mli: documentation des cas d'erreur de create, make
buffer.ml, buffer.mli: blindage de create
hashtbl.ml, hashtbl.mli: blindage de create
pervasives.ml: fix typo dans bool_of_string
gc.mli: utilisation de {r with l=v} dans l'exemple


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2411 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-10-02 12:09:43 +00:00
Xavier Leroy 57acfa7dec Dans create, s'assurer que la taille est > 0
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2374 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-05-15 17:06:56 +00:00
Xavier Leroy bfc8f1e575 Reinitialiser length dans reset
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2320 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-03-02 14:49:12 +00:00
Xavier Leroy a5eb7789fd Revu le module Buffer.
Utilise Buffer dans Printf.sprintf; ajout Printf.bprintf.
Ajout Map.mem.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2309 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-02-25 10:26:38 +00:00
Pierre Weis 90dc1e299a Suppresion de fonctions inutiles. Ajout d'un test dans la fonction
output pour tester les débordements.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2301 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-02-23 19:05:08 +00:00
Pierre Weis e5567afe2e Modification de bprintf pour la rendre plus semblable aux autres
versions de printf.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2293 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-02-17 18:51:28 +00:00
Pierre Weis e3f42c3acd Addition of sprintf and formatting on buffers.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2285 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-02-16 09:07:26 +00:00