Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Improve behavioural consistency of unallocated (zero length) `IO::Buffer`. ↵ | Samuel Williams | 2024-01-15 | 1 | -8/+6 |
| | | | | | | | (#9532) This makes the behaviour of IO::Buffer.new(0) and IO::Buffer.new.slice(0, 0) consistent. Fixes https://bugs.ruby-lang.org/issues/19542 and https://bugs.ruby-lang.org/issues/18805. | ||||
* | Fix Window private file mapping unlink EACCES issue. (#9358) | Samuel Williams | 2023-12-27 | 1 | -6/+12 |
| | | | | | | | * Don't return early. * Add missing `mapping` assignment. * Make debug logs conditional. | ||||
* | Correctly release the underlying file mapping. (#9340) | Samuel Williams | 2023-12-25 | 1 | -18/+22 |
| | | | * Avoiding using `Tempfile` which was retaining the file preventing it from unlinking. | ||||
* | IO::Buffer improvements and documentation. (#9329) | Samuel Williams | 2023-12-25 | 1 | -179/+365 |
| | | | | | | | | | | | * Restore experimental warnings. * Documentation and code structure improvements. * Improved validation of flags, clarified documentation of argument handling. * Remove inconsistent use of `Example:` and add example to `null?`. * Expose `IO::Buffer#private?` and add test. | ||||
* | Implement IO::Buffer on VWA | Peter Zhu | 2023-12-19 | 1 | -3/+1 |
| | |||||
* | [DOC] Add document of IO::Buffer#hexdump | Nobuyoshi Nakada | 2023-12-18 | 1 | -0/+1 |
| | |||||
* | Implement Write Barriers on IO::Buffer | Peter Zhu | 2023-12-14 | 1 | -15/+17 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | Benchmark: ``` require "benchmark" puts(Benchmark.measure do ary = 1_000_000.times.map { IO::Buffer.for("") } 10.times { GC.start(full_mark: false) } end) ``` Before: ``` 14.330119 0.051497 14.381616 ( 14.445106) ``` After: ``` 7.481152 0.040166 7.521318 ( 7.535209) ``` | ||||
* | Use xfree for IO::Buffer | Peter Zhu | 2023-12-12 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since IO::Buffer is allocated using TypedData_Make_Struct, it must use xfree to free the buffer otherwise it will cause more major GC to run. Example: ``` 10.times do 1_000_000.times { IO::Buffer.new(0) } puts "oldmalloc_increase_bytes: #{GC.stat(:oldmalloc_increase_bytes)}, major_gc_count: #{GC.stat(:major_gc_count)}" end ``` Before: ``` oldmalloc_increase_bytes: 14904176, major_gc_count: 3 oldmalloc_increase_bytes: 2399424, major_gc_count: 5 oldmalloc_increase_bytes: 5204640, major_gc_count: 6 oldmalloc_increase_bytes: 2199936, major_gc_count: 7 oldmalloc_increase_bytes: 34199936, major_gc_count: 7 oldmalloc_increase_bytes: 24223360, major_gc_count: 8 oldmalloc_increase_bytes: 5967616, major_gc_count: 9 oldmalloc_increase_bytes: 37967616, major_gc_count: 9 oldmalloc_increase_bytes: 9689792, major_gc_count: 10 oldmalloc_increase_bytes: 41689792, major_gc_count: 10 ``` After: ``` oldmalloc_increase_bytes: 117392, major_gc_count: 2 oldmalloc_increase_bytes: 26128, major_gc_count: 2 oldmalloc_increase_bytes: 71600, major_gc_count: 2 oldmalloc_increase_bytes: 117072, major_gc_count: 2 oldmalloc_increase_bytes: 17296, major_gc_count: 2 oldmalloc_increase_bytes: 62768, major_gc_count: 2 oldmalloc_increase_bytes: 108240, major_gc_count: 2 oldmalloc_increase_bytes: 153712, major_gc_count: 2 oldmalloc_increase_bytes: 53936, major_gc_count: 2 oldmalloc_increase_bytes: 99408, major_gc_count: 2 ``` | ||||
* | Don't warn generally for `IO::Buffer`, only on specific code paths e.g. ↵ | Samuel Williams | 2023-12-06 | 1 | -2/+0 |
| | | | | `map`. (#9131) | ||||
* | Fix `io_buffer_get_string` default length computation. (#8427) | Samuel Williams | 2023-09-14 | 1 | -160/+181 |
| | | | | | | | | * Fix `io_buffer_get_string` default length computation. When an offset bigger than the size is given, the resulting length will be computed incorrectly. Raise an argument error in this case. * Validate all arguments. | ||||
* | [Bug #19754] Make `IO::Buffer#get_string` check `offset` range (#8016) | Nobuyoshi Nakada | 2023-09-13 | 1 | -0/+3 |
| | |||||
* | [DOC] Improved documentation. (#8319) | Samuel Williams | 2023-08-29 | 1 | -2/+2 |
| | |||||
* | Improve `read`/`write`/`pread`/`pwrite` consistency. (#7860) | Samuel Williams | 2023-05-27 | 1 | -69/+116 |
| | | | | | | | * Documentation consistency. * Improve consistency of `pread`/`pwrite` implementation when given length. * Remove HAVE_PREAD / HAVE_PWRITE - it is no longer optional. | ||||
* | Improvements to `IO::Buffer` `read`/`write`/`pread`/`pwrite`. (#7826) | Samuel Williams | 2023-05-24 | 1 | -77/+170 |
| | | | - Fix IO::Buffer `read`/`write` to use a minimum length. | ||||
* | Fix mutation on shared strings. (#7837) | Samuel Williams | 2023-05-22 | 1 | -7/+12 |
| | |||||
* | Rename `data` -> `buffer` for better readability. (#7836) | Samuel Williams | 2023-05-22 | 1 | -386/+386 |
| | |||||
* | Support `IO#pread` / `IO#pwrite` using fiber scheduler. (#7594) | Samuel Williams | 2023-03-31 | 1 | -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 Williams | 2023-03-25 | 1 | -4/+4 |
| | |||||
* | IO::Buffer#resize: Free internal buffer if new size is zero (#7569) | Kasumi Hanazuki | 2023-03-25 | 1 | -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 Bampton | 2023-02-27 | 1 | -1/+1 |
| | |||||
* | Adjust `else` style to be consistent in each files [ci skip] | Nobuyoshi Nakada | 2023-02-26 | 1 | -11/+22 |
| | |||||
* | Prefer RB_NUM2LONG for string length. (#7379) | Samuel Williams | 2023-02-25 | 1 | -1/+1 |
| | |||||
* | Add `IO::Buffer.string` for efficient string creation. (#7364) | Samuel Williams | 2023-02-25 | 1 | -0/+30 |
| | |||||
* | [Bug #19459] Remove unnecessary always-true checks (#7362) | Nobuyoshi Nakada | 2023-02-23 | 1 | -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 Shepelev | 2022-12-24 | 1 | -10/+69 |
| | | | Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz> | ||||
* | Fix missing handling of offset argument in `IO::Buffer` `pread` and ↵ | Samuel Williams | 2022-12-24 | 1 | -4/+18 |
| | | | | `pwrite`. (#7012) | ||||
* | Use consistent style [ci skip] | Nobuyoshi Nakada | 2022-12-02 | 1 | -1/+2 |
| | |||||
* | Fix typos (#6775) | Yudai Takada | 2022-11-20 | 1 | -1/+1 |
| | | | | | | | | | | | * s/Innteger/Integer/ * s/diretory/directory/ * s/Bufer/Buffer/ * s/defalt/default/ * s/covearge/coverage/ | ||||
* | Using UNDEF_P macro | S-H-GAMELINKS | 2022-11-16 | 1 | -4/+4 |
| | |||||
* | [DOC] Fix IO::Buffer#slice rdoc position | Yusuke Nakamura | 2022-11-03 | 1 | -21/+21 |
| | | | | Before this change, rdoc shows empty in 'slice' method section | ||||
* | Fix format specifiers for `size_t` | Nobuyoshi Nakada | 2022-10-26 | 1 | -1/+1 |
| | |||||
* | Add support for anonymous shared IO buffers. (#6580) | Samuel Williams | 2022-10-19 | 1 | -3/+34 |
| | |||||
* | Improvements to IO::Buffer implementation and documentation. (#6525) | Samuel Williams | 2022-10-12 | 1 | -136/+299 |
| | |||||
* | Update `IO::Buffer` read/write to use rb_thread_io_blocking_region. (#6438) | Samuel Williams | 2022-09-26 | 1 | -40/+121 |
| | |||||
* | Add several new methods for getting and setting buffer contents. (#6434) | Samuel Williams | 2022-09-26 | 1 | -103/+406 |
| | |||||
* | [Bug #5317] Use `rb_off_t` instead of `off_t` | Nobuyoshi Nakada | 2022-09-08 | 1 | -14/+14 |
| | | | | Get rid of the conflict with system-provided small `off_t`. | ||||
* | Adjust styles [ci skip] | Nobuyoshi Nakada | 2022-07-27 | 1 | -1/+2 |
| | |||||
* | Append semicolons [ci skip] | Nobuyoshi Nakada | 2022-07-27 | 1 | -44/+44 |
| | |||||
* | Make indents and newlines consistent [ci skip] | Nobuyoshi Nakada | 2022-07-27 | 1 | -34/+46 |
| | |||||
* | Fix a variable name typo in the docs | Shannon Skipper | 2022-06-25 | 1 | -2/+2 |
| | |||||
* | Fix warnings by old gcc | Nobuyoshi Nakada | 2022-06-23 | 1 | -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 Williams | 2022-05-09 | 1 | -0/+405 |
| | |||||
* | Fix rdoc of IO::Buffer [ci skip] | Kazuhiro NISHIYAMA | 2022-05-09 | 1 | -14/+1 |
| | |||||
* | Explicit handling of frozen strings in `IO::Buffer#for`. (#5892) | Samuel Williams | 2022-05-09 | 1 | -25/+97 |
| | |||||
* | io_buffer.c: use mremap based resizing only when mremap available | Yuta Saito | 2022-01-07 | 1 | -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 Williams | 2022-01-02 | 1 | -7/+0 |
| | |||||
* | [DOC] Adjust IO::Buffer docs (#5374) | Victor Shepelev | 2022-01-02 | 1 | -20/+57 |
| | |||||
* | Fix typos [ci skip] | Kazuhiro NISHIYAMA | 2021-12-25 | 1 | -1/+1 |
| | |||||
* | Add fiber scheduler hooks for `pread`/`pwrite`, and add support to `IO::Buffer`. | Samuel Williams | 2021-12-23 | 1 | -0/+173 |
| | |||||
* | Extended interface for IO::Buffer & documentation. | Samuel Williams | 2021-12-22 | 1 | -77/+735 |
| |