mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
spaces in comments [ci skip]
This commit is contained in:
parent
122f96c362
commit
0d88fe3a72
Notes:
git
2020-05-11 09:24:42 +09:00
4 changed files with 12 additions and 12 deletions
|
@ -22,28 +22,28 @@
|
|||
*
|
||||
* ### Q&A ###
|
||||
*
|
||||
* - Q: There are seemingly similar attributes named #RBIMPL_ATTR_CONST,
|
||||
* - Q: There are seemingly similar attributes named #RBIMPL_ATTR_CONST,
|
||||
* #RBIMPL_ATTR_PURE, and #RBIMPL_ATTR_NOALIAS. What are the difference?
|
||||
*
|
||||
* - A: Allowed operations are different.
|
||||
*
|
||||
* - #RBIMPL_ATTR_CONST ... Functions attributed by this are not allowed to
|
||||
* - #RBIMPL_ATTR_CONST ... Functions attributed by this are not allowed to
|
||||
* read/write _any_ pointers at all (there are exceptional situations
|
||||
* when reading a pointer is possible but forget that; they are too
|
||||
* exceptional to be useful). Just remember that everything pointer-
|
||||
* related are NG.
|
||||
*
|
||||
* - #RBIMPL_ATTR_PURE ... Functions attributed by this can read any
|
||||
* - #RBIMPL_ATTR_PURE ... Functions attributed by this can read any
|
||||
* nonvolatile pointers, but no writes are allowed at all. The ability
|
||||
* to read _any_ nonvolatile pointers makes it possible to mark ::VALUE-
|
||||
* taking functions as being pure, as long as they are read-only.
|
||||
*
|
||||
* - #RBIMPL_ATTR_NOALIAS ... Can both read/write, but only through pointers
|
||||
* passed to the function as parameters. This is a typical situation
|
||||
* when you create a C++ non-static member function which only concerns
|
||||
* `this`. No global variables are allowed to read/write. So this is
|
||||
* not a super-set of being pure. If you want to read something, that
|
||||
* has to be passed to the function as a pointer. ::VALUE -taking
|
||||
* - #RBIMPL_ATTR_NOALIAS ... Can both read/write, but only through
|
||||
* pointers passed to the function as parameters. This is a typical
|
||||
* situation when you create a C++ non-static member function which only
|
||||
* concerns `this`. No global variables are allowed to read/write. So
|
||||
* this is not a super-set of being pure. If you want to read something,
|
||||
* that has to be passed to the function as a pointer. ::VALUE -taking
|
||||
* functions thus cannot be attributed as such.
|
||||
*/
|
||||
#include "ruby/impl/has/declspec_attribute.h"
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "ruby/impl/token_paste.h"
|
||||
|
||||
/* :FIXME: config.h includes conflicting `#define restrict`. MSVC can be
|
||||
* detected using `RBIMPL_COMPILER_SINCE()`, but Clang & family cannot use
|
||||
* detected using `RBIMPL_COMPILER_SINCE()`, but Clang & family cannot use
|
||||
* `__has_declspec_attribute()` which involves macro substitution. */
|
||||
|
||||
/** Wraps (or simulates) `__declspec(restrict)` */
|
||||
|
|
|
@ -102,7 +102,7 @@ RBIMPL_ATTR_CONST()
|
|||
RBIMPL_ATTR_CONSTEXPR(CXX11)
|
||||
RBIMPL_ATTR_ARTIFICIAL()
|
||||
/*
|
||||
* :NOTE: rbimpl_test HAS to be `__attribute__((const))` in order for clang to
|
||||
* :NOTE: rbimpl_test HAS to be `__attribute__((const))` in order for clang to
|
||||
* properly deduce `__builtin_assume()`.
|
||||
*/
|
||||
static inline bool
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
#endif
|
||||
|
||||
/**
|
||||
* Wraps (or simulates) `alignof`. Unlike #RBIMPL_ALIGNAS, we can safely say
|
||||
* Wraps (or simulates) `alignof`. Unlike #RBIMPL_ALIGNAS, we can safely say
|
||||
* both C/C++ definitions are effective.
|
||||
*/
|
||||
#if defined(__cplusplus) && RBIMPL_HAS_EXTENSION(cxx_alignof)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue