[#103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 — eregontp@...
Issue #17777 has been reported by Eregon (Benoit Daloze).
17 messages
2021/04/05
[#103305] [Ruby master Feature#17785] Allow named parameters to be keywords — marcandre-ruby-core@...
Issue #17785 has been reported by marcandre (Marc-Andre Lafortune).
21 messages
2021/04/08
[#103342] [Ruby master Feature#17790] Have a way to clear a String without resetting its capacity — jean.boussier@...
Issue #17790 has been reported by byroot (Jean Boussier).
14 messages
2021/04/09
[#103388] [ANN] Multi-factor Authentication of bugs.ruby-lang.org — SHIBATA Hiroshi <hsbt@...>
Hello,
5 messages
2021/04/12
[#103414] Re: [ANN] Multi-factor Authentication of bugs.ruby-lang.org
— Martin J. Dürst <duerst@...>
2021/04/13
Is there a way to use this multi-factor authentication for (like me)
[#103547] List of CI sites to check — Martin J. Dürst <duerst@...>
Hello everybody,
4 messages
2021/04/22
[#103596] [Ruby master Feature#17830] Add Integer#previous and Integer#prev — rafasoaresms@...
Issue #17830 has been reported by rafasoares (Rafael Soares).
9 messages
2021/04/26
[ruby-core:103357] Re: [Ruby master Feature#17790] Have a way to clear a String without resetting its capacity
From:
Eric Wong <normalperson@...>
Date:
2021-04-09 21:42:38 UTC
List:
ruby-core #103357
jean.boussier@gmail.com wrote: > > so providing a capacity method gives more control over how to expand memory > > Agreed. Without also exposing the capacity, my proposed change would be a big footgun. Yes, rb_str_resize(str, 0) is common to workaround the lack of escape analysis inside the core VM and some C exts. I think it's reasonable for Rubyists to use String#clear for the same purpose. > Maybe `String#capacity` and `String#capacity=` would make sense? But then there's the question of the behavior if you set the capacity to lower than the `size`. Should it truncate? (this could corrupt UTF-8 for instance) or should it raise? Yes, but I don't know what it should do for corruption. It would also be useful for IO#read-like methods if/when that supports destination buffer offsets. > Additionally I think `Array` and `Hash` should expose similar ways of querying and reserving capacity. Probably, yes. It seems a bit low-level, but I've been favoring "semi-automatic" memory management since we probably can't have escape analysis due to the C API. Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>