Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001578OCamlOCaml generalpublic2003-03-07 20:432013-08-31 12:46
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionsuspended 
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: 12-227-100-158.client.attbi.com (12.227.100.158)


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
(0006811)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker