summaryrefslogtreecommitdiff
path: root/internal/hash.h
Commit message (Collapse)AuthorAgeFilesLines
* Move ar_hint to ar_table_structPeter Zhu2023-05-171-10/+4
| | | | This allows Hashes with ST tables to fit int he 80 byte size pool.
* Implement Hash ST tables on VWAPeter Zhu2023-05-171-8/+19
|
* Implement Hash AR tables on VWAPeter Zhu2023-05-171-34/+6
|
* Stop exporting symbols for MJITTakashi Kokubun2023-03-061-2/+0
|
* Implement ObjectSpace::WeakKeyMap basic allocatorJean Boussier2023-02-231-0/+2
| | | | [Feature #18498]
* Remove rb_hash_st_tablePeter Zhu2023-01-311-1/+0
| | | | It's a duplicate of RHASH_ST_TABLE.
* Remove rb_hash_ar_tablePeter Zhu2023-01-311-26/+0
| | | | It's dead code and duplicate of RHASH_AR_TABLE.
* Fix typo in RHASH_ST_CLEARPeter Zhu2023-01-201-1/+1
| | | | We should be setting as.st and not as.ar.
* Restore Hash#compare_by_identity mode [Bug #18171]Nobuyoshi Nakada2021-10-021-0/+2
|
* Add rb_ident_hash_new_with_sizeNobuyoshi Nakada2021-10-021-0/+1
|
* internal/*.h: skip doxygen卜部昌平2021-09-101-1/+0
| | | | | These contents are purely implementation details, not worth appearing in CAPI documents. [ci skip]
* Ractor.make_shareable(obj)Koichi Sasada2020-10-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduce new method Ractor.make_shareable(obj) which tries to make obj shareable object. Protocol is here. (1) If obj is shareable, it is shareable. (2) If obj is not a shareable object and if obj can be shareable object if it is frozen, then freeze obj. If obj has reachable objects (rs), do rs.each{|o| Ractor.make_shareable(o)} recursively (recursion is not Ruby-level, but C-level). (3) Otherwise, raise Ractor::Error. Now T_DATA is not a shareable object even if the object is frozen. If the method finished without error, given obj is marked as a sharable object. To allow makng a shareable frozen T_DATA object, then set `RUBY_TYPED_FROZEN_SHAREABLE` as type->flags. On default, this flag is not set. It means user defined T_DATA objects are not allowed to become shareable objects when it is frozen. You can make any object shareable by setting FL_SHAREABLE flag, so if you know that the T_DATA object is shareable (== thread-safe), set this flag, at creation time for example. `Ractor` object is one example, which is not a frozen, but a shareable object.
* include/ruby/backward/2/r_cast.h: deprecate卜部昌平2020-08-271-1/+1
| | | | | Remove all usages of RCAST() so that the header file can be excluded from ruby/ruby.h's dependency.
* RHASH_EMPTY_P: convert into an inline function卜部昌平2020-08-191-0/+11
|
* RHASH_TBL: is now ext-only卜部昌平2020-08-191-5/+0
| | | | | It seems almost no internal codes use RHASH_TBL any longer. Why not just eliminate it entirely, so that the macro can be purely ext-only.
* sed -i 's|ruby/impl|ruby/internal|'卜部昌平2020-05-111-2/+2
| | | | To fix build failures.
* sed -i s|ruby/3|ruby/impl|g卜部昌平2020-05-111-2/+2
| | | | This shall fix compile errors.
* add #include guard hack卜部昌平2020-04-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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-9/+9
| | | Split ruby.h
* decouple internal.h headers卜部昌平2019-12-261-2/+8
| | | | | | | | | | | | | | | | | | Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies).
* internal/hash.h rework卜部昌平2019-12-261-79/+164
| | | | | | | | Reduce macros to make them inline functions, as well as mark MJIT_FUNC_EXPORTED functions explicitly as such. Definition of ar_hint_t is simplified. This has been the only possible definition so far.
* split internal.h into files卜部昌平2019-12-261-0/+143
One day, I could not resist the way it was written. I finally started to make the code clean. This changeset is the beginning of a series of housekeeping commits. It is a simple refactoring; split internal.h into files, so that we can divide and concur in the upcoming commits. No lines of codes are either added or removed, except the obvious file headers/footers. The generated binary is identical to the one before.