summaryrefslogtreecommitdiff
path: root/io_buffer.c
Commit message (Collapse)AuthorAgeFilesLines
* Support `IO#pread` / `IO#pwrite` using fiber scheduler. (#7594)Samuel Williams2023-03-311-5/+22
| | | * Skip test if non-blocking file IO is not supported.
* Fix incorrect usage of `rb_fiber_scheduler_io_(p)(read|write)`. (#7593)Samuel Williams2023-03-251-4/+4
|
* IO::Buffer#resize: Free internal buffer if new size is zero (#7569)Kasumi Hanazuki2023-03-251-0/+5
| | | | | | | | | | `#resize(0)` on an IO::Buffer with internal buffer allocated will result in calling `realloc(data->base, 0)`. The behavior of `realloc` with size = 0 is implementation-defined (glibc frees the object and returns NULL, while BSDs return an inaccessible object). And thus such usage is deprecated in standard C (upcoming C23 will make it UB). To avoid this problem, just `free`s the memory when the new size is zero.
* Fix spelling (#7389)John Bampton2023-02-271-1/+1
|
* Adjust `else` style to be consistent in each files [ci skip]Nobuyoshi Nakada2023-02-261-11/+22
|
* Prefer RB_NUM2LONG for string length. (#7379)Samuel Williams2023-02-251-1/+1
|
* Add `IO::Buffer.string` for efficient string creation. (#7364)Samuel Williams2023-02-251-0/+30
|
* [Bug #19459] Remove unnecessary always-true checks (#7362)Nobuyoshi Nakada2023-02-231-17/+7
| | | | | `length` is a required argument for `IO::Buffer#read` and `IO::Buffer#write` methods, and `argc` is already checked with `rb_check_arity`. Also fix the call-seq of `IO::Buffer#read`.
* [DOC] Document new methods of IO::Buffer and Fiber::Scheduler (#7016)Victor Shepelev2022-12-241-10/+69
| | | Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz>
* Fix missing handling of offset argument in `IO::Buffer` `pread` and ↵Samuel Williams2022-12-241-4/+18
| | | | `pwrite`. (#7012)
* Use consistent style [ci skip]Nobuyoshi Nakada2022-12-021-1/+2
|
* Fix typos (#6775)Yudai Takada2022-11-201-1/+1
| | | | | | | | | | | * s/Innteger/Integer/ * s/diretory/directory/ * s/Bufer/Buffer/ * s/defalt/default/ * s/covearge/coverage/
* Using UNDEF_P macroS-H-GAMELINKS2022-11-161-4/+4
|
* [DOC] Fix IO::Buffer#slice rdoc positionYusuke Nakamura2022-11-031-21/+21
| | | | Before this change, rdoc shows empty in 'slice' method section
* Fix format specifiers for `size_t`Nobuyoshi Nakada2022-10-261-1/+1
|
* Add support for anonymous shared IO buffers. (#6580)Samuel Williams2022-10-191-3/+34
|
* Improvements to IO::Buffer implementation and documentation. (#6525)Samuel Williams2022-10-121-136/+299
|
* Update `IO::Buffer` read/write to use rb_thread_io_blocking_region. (#6438)Samuel Williams2022-09-261-40/+121
|
* Add several new methods for getting and setting buffer contents. (#6434)Samuel Williams2022-09-261-103/+406
|
* [Bug #5317] Use `rb_off_t` instead of `off_t`Nobuyoshi Nakada2022-09-081-14/+14
| | | | Get rid of the conflict with system-provided small `off_t`.
* Adjust styles [ci skip]Nobuyoshi Nakada2022-07-271-1/+2
|
* Append semicolons [ci skip]Nobuyoshi Nakada2022-07-271-44/+44
|
* Make indents and newlines consistent [ci skip]Nobuyoshi Nakada2022-07-271-34/+46
|
* Fix a variable name typo in the docsShannon Skipper2022-06-251-2/+2
|
* Fix warnings by old gccNobuyoshi Nakada2022-06-231-2/+2
| | | | | | * Use PRIxSIZE instead of "z" * Fix sign-compare warning * Suppress unused-but-set-variable warning
* Add basic binary operators (and, or, xor, not) to `IO::Buffer`. (#5893)Samuel Williams2022-05-091-0/+405
|
* Fix rdoc of IO::Buffer [ci skip]Kazuhiro NISHIYAMA2022-05-091-14/+1
|
* Explicit handling of frozen strings in `IO::Buffer#for`. (#5892)Samuel Williams2022-05-091-25/+97
|
* io_buffer.c: use mremap based resizing only when mremap availableYuta Saito2022-01-071-1/+1
| | | | | some libc implementations (e.g. wasi-libc) define MREMAP_MAYMOVE, but don't have mremap itself, so guard the use of mremap by HAVE_MREMAP
* Remove UTF-8 from documentation.Samuel Williams2022-01-021-7/+0
|
* [DOC] Adjust IO::Buffer docs (#5374)Victor Shepelev2022-01-021-20/+57
|
* Fix typos [ci skip]Kazuhiro NISHIYAMA2021-12-251-1/+1
|
* Add fiber scheduler hooks for `pread`/`pwrite`, and add support to `IO::Buffer`.Samuel Williams2021-12-231-0/+173
|
* Extended interface for IO::Buffer & documentation.Samuel Williams2021-12-221-77/+735
|
* Rename IMMUTABLE to READONLY.Samuel Williams2021-12-211-27/+43
|
* Improve interface for get/set/copy.Samuel Williams2021-12-211-53/+116
|
* Fix handling of clear with offset and without length.Samuel Williams2021-12-211-1/+3
|
* Mark non-private mapped files as external.Samuel Williams2021-12-211-8/+7
|
* Default `IO::Buffer#get_string` to use BINARY encoding.Samuel Williams2021-12-211-1/+1
|
* Rename `to_str` -> `get_string` and add support for encodings.Samuel Williams2021-12-211-30/+32
|
* Improved exception usage/classes.Samuel Williams2021-12-211-20/+26
|
* Fix handling of frozens strings.Samuel Williams2021-12-211-1/+6
|
* Fix mapping invalid non-file object.Samuel Williams2021-12-211-0/+3
|
* Improve IO::Buffer resize and introduce ownership transfer.Samuel Williams2021-12-201-41/+149
|
* Default size for IO::Buffer.Samuel Williams2021-12-191-4/+38
|
* Fix spelling of DECLAIR_TYPE.Samuel Williams2021-12-191-24/+24
|
* Adjust formatNobuyoshi Nakada2021-11-211-10/+21
|
* Validate string type when constructing IO::Buffer for string mapping.Samuel Williams2021-11-171-0/+2
|
* Fix 32-bit conversions in IO::Buffer implementation.Samuel Williams2021-11-171-5/+18
|
* Rework implementation of `IO::Buffer.for(string)` to use string locking.Samuel Williams2021-11-121-0/+20
|