summaryrefslogtreecommitdiff
path: root/ruby_assert.h
Commit message (Collapse)AuthorAgeFilesLines
* internal/*.h: skip doxygen卜部昌平2021-09-101-1/+0
| | | | | These contents are purely implementation details, not worth appearing in CAPI documents. [ci skip]
* Introduce Ractor mechanism for parallel executionKoichi Sasada2020-09-031-1/+0
| | | | | | | | | | | | | | | | This commit introduces Ractor mechanism to run Ruby program in parallel. See doc/ractor.md for more details about Ractor. See ticket [Feature #17100] to see the implementation details and discussions. [Feature #17100] This commit does not complete the implementation. You can find many bugs on using Ractor. Also the specification will be changed so that this feature is experimental. You will see a warning when you make the first Ractor with `Ractor.new`. I hope this feature can help programmers from thread-safety issues.
* Use RUBY_DEBUG instead of NDEBUGKoichi Sasada2020-05-261-8/+3
| | | | | | | | | | | | | | Assertions in header files slows down an interpreter, so they should be turned off by default (simple `make`). To enable them, define a macro `RUBY_DEBUG=1` (e.g. `make cppflags=-DRUBY_DEBUG` or use `#define` at the very beggining of the file. Note that even if `NDEBUG=1` is defined, `RUBY_DEBUG=1` enables all assertions. [Feature #16837] related: https://github.com/ruby/ruby/pull/3120 `assert()` lines in MRI *.c is not disabled even if `RUBY_DEBUG=0` and it can be disabled with `NDEBUG=1`. So please consider to use `RUBY_ASSERT()` if you want to disable them when `RUBY_DEBUG=0`.
* add #include guard hack卜部昌平2020-04-131-0/+11
| | | | | | | | | | | | | | | | | | | | | | According to MSVC manual (*1), cl.exe can skip including a header file when that: - contains #pragma once, or - starts with #ifndef, or - starts with #if ! defined. GCC has a similar trick (*2), but it acts more stricter (e. g. there must be _no tokens_ outside of #ifndef...#endif). Sun C lacked #pragma once for a looong time. Oracle Developer Studio 12.5 finally implemented it, but we cannot assume such recent version. This changeset modifies header files so that each of them include strictly one #ifndef...#endif. I believe this is the most portable way to trigger compiler optimizations. [Bug #16770] *1: https://docs.microsoft.com/en-us/cpp/preprocessor/once *2: https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-5/+0
| | | Split ruby.h
* respect NDEBUG.Koichi Sasada2019-07-191-0/+5
| | | | | | | | | ruby/ruby.h includes ruby/assert.h, and RUBY_NDEBUG is defined by checking NDEBUG. In other words, NDEBUG is only seen just after ruby/ruby.h. This patch also cheks NDEBUG just after including ruby_assert.h. Without this patch, assertions in array.c are always enabled.
* Split RUBY_ASSERT and so on under include/rubyNobuyoshi Nakada2019-07-141-51/+1
|
* string literal longer than 509 characters is a C99ismshyouhei2018-01-021-0/+6
| | | | | | Should avoid such thing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix build with VM_CHECK_MODE > 0normal2016-01-251-1/+1
| | | | | | | | | | | * ruby_assert.h (RUBY_ASSERT_WHEN): fix reference to macro name * vm_core.h: include ruby_assert.h before using [ruby-core:73371] This does not fix the test failure documented in [ruby-core:73371], that is for later. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h: use RUBY_ASSERTnobu2016-01-221-0/+1
| | | | | | * vm_core.h (VM_ASSERT): use RUBY_ASSERT instead of rb_bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* RUBY_ASSERTnobu2016-01-221-0/+53
* error.c (rb_assert_failure): assertion with stack dump. * ruby_assert.h (RUBY_ASSERT): new header for the assertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e