Граф коммитов

2029 Коммитов

Автор SHA1 Сообщение Дата
卜部昌平 33533fabd5 revival of must_not_null()
Presence of RBIMPL_ATTR_NONNULL let C compilers to eliminate
must_not_null().  Because null pointers are not allowed to exist there
are no reason to call the function.  In reality null pointers are still
passed to those functions in a number of ways.  Runtime check for them
are definitely nice to have.  fix [Feature#18280]
2021-11-11 17:14:47 +09:00
卜部昌平 f5dcecf345 rb_file_size: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-11-11 11:45:19 +09:00
卜部昌平 ad84c5d1b0 rb_enc_code_to_mbclen: fix doxygen
Wrong parameter name. [ci skip]
2021-11-11 11:45:19 +09:00
卜部昌平 4b3830127f RB_ENCODING_SET_INLINED: fix doxygen
Wrong parameter name. [ci skip]
2021-11-11 11:45:19 +09:00
卜部昌平 a4a6e5cd2e ENCODING_MASK: fix doxygen link [ci skip] 2021-11-11 11:45:19 +09:00
卜部昌平 1370b0876f io/buffer.h: C linkage
Because `make install` installs this header to target systems, it must
be ready to be `#include`d form a C++ program.
2021-11-11 11:45:19 +09:00
Nobuyoshi Nakada 46e46eafd4
size_t is not for file size 2021-11-10 16:41:26 +09:00
Samuel Williams 81d0ce7e97 Mark IO::Buffer as experimental. 2021-11-10 19:21:05 +13:00
Samuel Williams 4b89034218 IO::Buffer for scheduler interface. 2021-11-10 19:21:05 +13:00
Peter Zhu 309406484b [Feature #18290] Deprecate rb_gc_force_recycle and remove invalidate_mark_stack_chunk
This commit deprecates rb_gc_force_recycle and coverts it to a no-op
function. Also removes invalidate_mark_stack_chunk since only
rb_gc_force_recycle uses it.
2021-11-08 14:05:54 -05:00
Kenta Murata 3501e0cbb5
memory_view.c: Add _memory_view_entry member in rb_memory_view_t (#5088) 2021-11-08 12:52:09 +09:00
Nobuyoshi Nakada a202408180
Fix typos 2021-11-02 19:17:37 +09:00
Jeremy Evans 717ab0bb2e
Add Class#descendants
Doesn't include receiver or singleton classes.

Implements [Feature #14394]

Co-authored-by: fatkodima <fatkodima123@gmail.com>
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2021-10-26 12:35:21 -07:00
卜部昌平 7d4c59203f improve doc coverage [ci skip]
Just split the comment for struct's one and array's one.
2021-10-26 09:30:42 +09:00
卜部昌平 a0029ae2b6 just another evidence that @shyouhei is an idiot [ci skip]
(gdb) ptype/o struct RString
/* offset    |  size */  type = struct RString {
/*    0      |    16 */    struct RBasic {
/*    0      |     8 */        VALUE flags;
/*    8      |     8 */        const VALUE klass;

                               /* total size (bytes):   16 */
                           } basic;
/*   16      |    24 */    union {
/*                24 */        struct {
/*   16      |     8 */            long len;
/*   24      |     8 */            char *ptr;
/*   32      |     8 */            union {
/*                 8 */                long capa;
/*                 8 */                VALUE shared;

                                       /* total size (bytes):    8 */
                                   } aux;

                                   /* total size (bytes):   24 */
                               } heap;
/*                24 */        struct {
/*   16      |    24 */            char ary[24];

                                   /* total size (bytes):   24 */
                               } embed;
/* XXX  8-byte padding  */

                               /* total size (bytes):   24 */
                           } as;

                           /* total size (bytes):   40 */
                         }
(gdb)
2021-10-26 09:30:12 +09:00
Peter Zhu a5b6598192 [Feature #18239] Implement VWA for strings
This commit adds support for embedded strings with variable capacity and
uses Variable Width Allocation to allocate strings.
2021-10-25 13:26:23 -04:00
Peter Zhu 46b66eb9e8 [Feature #18239] Add struct for embedded strings 2021-10-25 13:26:23 -04:00
Shugo Maeda 6606597109
Deprecate include/prepend in refinements and add Refinement#import_methods instead
Refinement#import_methods imports methods from modules.
Unlike Module#include, it copies methods and adds them into the refinement,
so the refinement is activated in the imported methods.

[Bug #17429] [ruby-core:101639]
2021-10-21 16:31:54 +09:00
Nobuyoshi Nakada 702a58e9e5
Remove duplicate type qualifiers
`rb_encoding` is defined as `const OnigEncodingType`.
Fix lots of C4114 warnings for each files by MSVC.
2021-10-06 14:01:43 +09:00
Nobuyoshi Nakada cd182c5ee1
Adjust types to rb_enc_left_char_head
I dislike unnatural casts.
2021-10-05 17:14:29 +09:00
卜部昌平 f032c09bca rb_enc_left_char_head(): take void*
Nobu doesn't like (char*) cast.
2021-10-05 14:18:23 +09:00
卜部昌平 5112a54846 include/ruby/encoding.h: convert macros into inline functions
Less macros == huge win.
2021-10-05 14:18:23 +09:00
卜部昌平 312668cf03 split include/ruby/encoding.h
2,291 lines are too much!  include/ruby/encoding.h became the biggest
header file once it had doxygen comments.  Let us split it into smaller
parts, so that we can better organise their contents.
2021-10-05 14:18:23 +09:00
卜部昌平 2fa4715bf2 rb_ractor_shareable_p(): fix doxygen
My bad.  The document is clearly broken.  Maybe I pressed my delete key
too much. [ci skip]
2021-10-05 14:18:23 +09:00
卜部昌平 90f2ab9d62 rb_fiber_raise(): add doxygen
Must not be a bad idea to improve documents.
2021-09-30 20:55:23 +13:00
Nobuyoshi Nakada f7ffe9dbde
Introduce `RBIMPL_NONNULL_ARG` macro
Runtime assertion for the argument declared as non-null.
This macro does nothing if `RBIMPL_ATTR_NONNULL` is effective,
otherwise asserts that the argument is non-null.
2021-09-27 14:47:52 +09:00
Nobuyoshi Nakada 63297c2ca4
Align the implementation precedences with `rb_atomic_t` definition
On MinGW, where both of Win32 API and GCC built-ins are available,
the mismatch of implementations to the definition caused lots of
warnings.
2021-09-24 10:11:32 +09:00
卜部昌平 0dea31c437 RBIMPL_ATTR_NOALIAS: not until LLVM 12
I observed CI failures.
https://github.com/ruby/ruby/actions/runs/1240165911

It turns out that  RBIMPL_ATTR_NOALIAS was not mature before.  Skip
using it for old clang, and everything work as expected.
2021-09-22 16:37:13 +09:00
卜部昌平 ecaf3a391d include/ruby/atomic.h: rework
Reduce macros to do the same things in inline functions instead.  This
way assertions can be made granular.
2021-09-22 16:37:13 +09:00
Samuel Williams 88ba5fe547 Expose `rb_fiber_raise` and tidy up the internal implementation. 2021-09-20 18:30:51 +12:00
卜部昌平 63ab2fedc8 include/ruby/atomic.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-15 09:25:23 +09:00
Nobuyoshi Nakada b568e6a130
Suppress deprecated rb_iterate declaration warnings in C++
Apply commit:733ffa74cd32a5c11ff744a5490782daa00ff1ae again.
2021-09-11 17:54:11 +09:00
Nobuyoshi Nakada cd829bb078 Remove printf family from the mjit header
Linking printf family functions makes mjit objects to link
unnecessary code.
2021-09-11 08:41:32 +09:00
卜部昌平 c39dd708b5 suppress GCC's -Wmissing-attribute
I was not aware of this because I use clang these days.
2021-09-10 20:00:06 +09:00
卜部昌平 6522b51ce5 rb_ary_new_from_values: can take NULLs
Explicit check done at runtime.
2021-09-10 20:00:06 +09:00
卜部昌平 dddc618d30 suppress GCC's -Wsuggest-attribute=format
I was not aware of this because I use clang these days.
2021-09-10 20:00:06 +09:00
卜部昌平 fd12bc1896 ruby_scan_oct, ruby_scan_hex: are not pure
Silly bug, they write back consumed bytes through passed pointers.  Must
never be pure functions.

ruby_scan_oct does not refer any static variables so it can still be
__declspec(noalias), while ruby_scan_hex is not because it reads from
ruby_digit36_to_number_table.
2021-09-10 20:00:06 +09:00
卜部昌平 4f03930d04 ruby_cleanup: fix MSVC compile error
See https://ci.appveyor.com/project/ruby/ruby/builds/40686153/job/1wihxw5m5kybtohj
2021-09-10 20:00:06 +09:00
卜部昌平 676073b62e include/ruby.h: skip doxygen
Everything defined in this header file are for backwards compatibility
only.  No one practically need them any longer. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 4702b59f21 include/ruby/backward.h: skip doxygen
There is nothing interesting here. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 6420db8ab7 include/ruby/debug.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 1563526edf include/ruby/defines.h: add doxygen
The only thing that remains in this file which is still worth
documenting is the RUBY macro.  Everything else were split into many
files in
1ff4cee2b1

[ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 6e8e2b467b forgot to delete a redundant comment 2021-09-10 20:00:06 +09:00
卜部昌平 3ca688aeb0 include/ruby/encoding.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 84b96298b3 include/ruby/fiber/scheduler.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 809138fe4b include/ruby/io.h: add doxyen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 6204b0dd99 include/ruby/memory_view.h: add doxygen
I'm just applying doc/memory_view.md as a doxygen comment. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 5a79439a68 include/ruby/missing.h: skip doxygen
We don't want to document e.g. M_PI, which is an ISO C thing.
2021-09-10 20:00:06 +09:00
卜部昌平 56c0475036 include/ruby/ractor.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 2c4dccad33 include/ruby/random.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00