mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
Use symbols instead of _IONBF values as args to setvbuf
* libguile/ports.c (scm_setvbuf): Use the symbols `none', `line', and `block' instead of the values `_IONBF', `_IOLBF', and `_IOFBF'. * NEWS: Update. * doc/ref/posix.texi (Ports and File Descriptors): Update setvbuf documentation. * module/ice-9/deprecated.scm (define-deprecated): New helper. (_IONBF, _IOLBF, _IOFBF): Define deprecated values. * benchmark-suite/benchmarks/read.bm ("read"): * benchmark-suite/benchmarks/uniform-vector-read.bm ("uniform-vector-read!"): * libguile/r6rs-ports.c (cbip_fill_input): * module/system/base/types.scm (%ffi-memory-backend): * module/web/client.scm (open-socket-for-uri): * module/web/server/http.scm (http-read): * test-suite/tests/ports.test ("pipe, fdopen, and line buffering"): ("setvbuf"): * test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports"): Update to use non-deprecated interfaces.
This commit is contained in:
parent
0a0a8d819d
commit
59a18451b8
12 changed files with 103 additions and 72 deletions
|
@ -51,20 +51,20 @@
|
|||
|
||||
(with-benchmark-prefix "read"
|
||||
|
||||
(benchmark "_IONBF" 5 ;; this one is very slow
|
||||
(exercise-read (list _IONBF)))
|
||||
(benchmark "'none" 5 ;; this one is very slow
|
||||
(exercise-read (list 'none)))
|
||||
|
||||
(benchmark "_IOLBF" 10
|
||||
(exercise-read (list _IOLBF)))
|
||||
(benchmark "'line" 10
|
||||
(exercise-read (list 'line)))
|
||||
|
||||
(benchmark "_IOFBF 4096" 10
|
||||
(exercise-read (list _IOFBF 4096)))
|
||||
(benchmark "'block 4096" 10
|
||||
(exercise-read (list 'block 4096)))
|
||||
|
||||
(benchmark "_IOFBF 8192" 10
|
||||
(exercise-read (list _IOFBF 8192)))
|
||||
(benchmark "'block 8192" 10
|
||||
(exercise-read (list 'block 8192)))
|
||||
|
||||
(benchmark "_IOFBF 16384" 10
|
||||
(exercise-read (list _IOFBF 16384)))
|
||||
(benchmark "'block 16384" 10
|
||||
(exercise-read (list 'block 16384)))
|
||||
|
||||
(benchmark "small strings" 100000
|
||||
(call-with-input-string small read))
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
(benchmark "uniform-vector-read!" 20000
|
||||
(let ((input (open-input-file file-name)))
|
||||
(setvbuf input _IONBF)
|
||||
(setvbuf input 'none)
|
||||
(uniform-vector-read! buf input)
|
||||
(close input)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue