Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001578OCaml~DO NOT USE (was: OCaml general)public2003-03-07 20:432013-08-31 12:46
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001578: feature request: Buffer.add_byte
DescriptionFull_Name: Eric Cooper
Version: 3.06
OS: linux
Submission from: (

Please add the function

    val add_byte : t -> int -> unit

to the Buffer module, where (add_byte buf n) is equivalent to
(add_char buf (Char.chr n)), but hopefully more efficient.

I wouldn't mind if only the low 8 bits of n are stored, using %string_safe_set.
Thanks for considering this.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2012-01-26 15:05

The cost of Char.chr is only two comparisons with constants, so it is probably not worth the trouble of using %string_safe_set (which is not documented to truncate its input).

Whatever the implementation, do we want to provide add_byte in buffer.mli? There doesn't seem to be much demand for it.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2012-01-26 15:05 doligez Note Added: 0006811
2012-01-26 15:05 doligez Status acknowledged => resolved
2012-01-26 15:05 doligez Resolution open => suspended
2012-01-26 15:05 doligez Description Updated View Revisions
2013-08-31 12:46 xleroy Status resolved => closed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker