2070 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
59a91f229b
Mark rb_clear_constant_cache as internal use only
In the past, many internal functions are declared in intern.h
under include/ruby directory, because there were no headers for
internal use.
2022-01-20 13:54:37 +09:00
Yuta Saito
528344b8de include/ruby/win32.h: explicitly define HAVE_SHUTDOWN
Configuration for mingw32 can't detect 'shutdown' due to wrong -l
option even though it's available (this has been going on for a while,
and it needs to be fixed).
In this situation, include/ruby/missing.h declares a stub shutdown
function since 7ee786388a, and another shutdown decl is came from
system header. They are incompatible at stdcall attribute, so it
causes compilation failure.
This change defines a HAVE_SHUTDOWN to guard a newly introduced stub
decl in include/ruby/missing.h
2022-01-19 17:52:19 +09:00
Yuta Saito
8c21701968 include/ruby/io.h: use 0 as POLLPRI when no support for it
0x003 is not suitable as a bit mask, and it's ok just to be 0 to avoid
setting unsupported bit.
2022-01-19 13:19:58 +09:00
Yuta Saito
50f1468bfd [wasm] include/ruby/io.h: define RB_WAITFD_PRI by ourselves for wasi
RB_WAITFD_PRI uses POLLPRI for other platforms, but wasi-libc doesn't
have POLLPRI for now.
2022-01-19 11:19:06 +09:00
Yuta Saito
420622b5a7 [wasm] add no thread variant for freestanding environment
This implementation does nothing around preemptive context switching
because there is no native thread.
2022-01-19 11:19:06 +09:00
Yuta Saito
7ee786388a [wasm] wasm/missing.{c,h}: add missing libc stubs for wasi-libc 2022-01-19 11:19:06 +09:00
Jeremy Evans
e7b4abf384 Don't assume __builtin_bswap32 and __builtin_bswap64 are defined on OpenBSD
At least OpenBSD/sparc64 doesn't appear to define them, and possibly
some other OpenBSD GCC platforms don't (most OpenBSD platforms have
already switched to clang).
2022-01-18 11:40:13 -08:00
Peter Zhu
ffda21b7ba [Feature #18491] Drop support for HP-UX
IA64 support was dropped in ticket #15894, so we can drop support for
HP-UX.
2022-01-18 09:52:15 -05:00
Yuta Saito
6729258839
include/ruby/win32.h: define HAVE_X for the missing prototypes (#5456) 2022-01-18 19:08:07 +09:00
Nobuyoshi Nakada
9fa9cf4006 Suppress possible loss of data warnings 2022-01-14 13:46:12 +09:00
Nobuyoshi Nakada
d1a55851e8
[DOC] Fix a typo in a doc 2022-01-13 11:32:35 +09:00
Peter Zhu
98fb0ab60e Enable Variable Width Allocation by default 2022-01-12 12:00:55 -05:00
Peter Zhu
2d81a718ec Make embedded string length a long for VWA
A short (2 bytes) will cause unaligned struct accesses when strings are
used as a buffer to directly store binary data.
2022-01-12 12:00:55 -05:00
Peter Zhu
33cc8816be Revert "Enable Variable Width Allocation by default"
This reverts commit c365c5921ea26e31c03a85b01ff4c04629abfc10.
2022-01-08 15:07:57 -05:00
Peter Zhu
bc643bbe2e Use unsigned short for length of embedded strings 2022-01-07 15:48:06 -05:00
Peter Zhu
c365c5921e Enable Variable Width Allocation by default 2022-01-07 13:27:13 -05:00
Peter Zhu
aeb344e65c Revert "Enable Variable Width Allocation by default"
This reverts commit d4a95428bb244ca8c4a97ad50f3837f191f1f0c3.
2022-01-06 16:47:49 -05:00
Peter Zhu
d4a95428bb Enable Variable Width Allocation by default 2022-01-06 14:33:35 -05:00
Nobuyoshi Nakada
8727161fcf
Flush deprecation declarations for versions older than 3.0 2021-12-30 18:52:04 +09:00
Nobuyoshi Nakada
a90d188b57 Remove declarations of deprecated functions 2021-12-30 15:33:40 +09:00
U.Nakamura
4e007d705c Fix some bornheads 2021-12-27 17:15:09 +09:00
U.Nakamura
9790f54bff Call FlushInstrucitonCache() when PROT_EXEC is specified to mprotect 2021-12-27 16:38:29 +09:00
U.Nakamura
85a426dc86 Tiny mmap emulation for Windows
- prerequisite of supporting YJIT with VC++.
- note that now can specfily `--yjit` on mswin64, but not enabled
  YJIT'ed code because of YJIT requires `OPT_DIRECT_THREADED_CODE`
  or `OPT_CALL_THREADED_CODE` in `rb_yjit_compile_iseq`.
2021-12-27 15:56:23 +09:00
Nobuyoshi Nakada
7c738ce5e6
Remove deprecate rb_cData [Bug #18433]
Also enable the warning for T_DATA allocator.
2021-12-26 23:28:54 +09:00
Nobuyoshi Nakada
39bc5de833
Remove tainted and trusted features
Already these had been announced to be removed in 3.2.
2021-12-26 23:28:54 +09:00
Yukihiro "Matz" Matsumoto
81c248924d
Development of 3.1.0 started. 2021-12-26 23:22:26 +09:00
Kazuhiro NISHIYAMA
04f07713d1
Fix typos [ci skip] 2021-12-25 10:33:49 +09:00
Samuel Williams
acfe2f2655
Improvements to rb_io_wait return value handling and internal implementation. (#5340) 2021-12-24 23:11:02 +13:00
Samuel Williams
bed920f073
Add fiber scheduler hooks for pread/pwrite, and add support to IO::Buffer. 2021-12-23 12:20:09 +13:00
Samuel Williams
e30920354f
Extended interface for IO::Buffer & documentation. 2021-12-22 10:57:34 +13:00
Samuel Williams
617687df09 Rename IMMUTABLE to READONLY. 2021-12-21 12:25:42 +13:00
Samuel Williams
9fbf94ff04 Improve interface for get/set/copy. 2021-12-21 12:25:42 +13:00
Samuel Williams
c86bcd434d Mark non-private mapped files as external. 2021-12-21 12:25:42 +13:00
Samuel Williams
49166fc74a Improved exception usage/classes. 2021-12-21 12:25:42 +13:00
Samuel Williams
56811617ab Improve IO::Buffer resize and introduce ownership transfer. 2021-12-20 00:17:17 +13:00
Samuel Williams
f3e30b26c5 Default size for IO::Buffer. 2021-12-19 12:25:38 +13:00
Samuel Williams
42d3231154
Introduce io_result wrapper for passing [-errno, size] in VALUE. 2021-12-18 18:19:30 +13:00
Yuta Saito
ecb2ff6050 intern/select/posix.h: remove unused parameter from rb_fd_dup
This unused parameter seems to be accidently introduced by https://github.com/ruby/ruby/commit/9e6e39c
2021-12-11 02:23:30 +09:00
Nobuyoshi Nakada
a5baf8d6bc
Revert zero-check for alloca
Something weird results in int-in-bool-context and
stringop-overflow warnings.
2021-12-10 18:39:48 +09:00
Nobuyoshi Nakada
bcc2bb28b0 Fix stack buffer overflow
https://hackerone.com/reports/1306859
2021-12-10 01:04:59 +09:00
Jean Boussier
c0c2b31a35 Add Class#subclasses
Implements [Feature #18273]

Returns an array containing the receiver's direct subclasses without
singleton classes.
2021-11-23 10:50:44 +01:00
卜部昌平
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