summaryrefslogtreecommitdiff
path: root/internal/hash.h
AgeCommit message (Collapse)Author
2023-09-24Add rb_hash_free for the GC to usePeter Zhu
2023-06-23Declare `RHASH_AR_TABLE` and `RHASH_ST_TABLE` return non-nullNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7976 Merged-By: nobu <[email protected]>
2023-06-08Remove RHASH_TRANSIENT_FLAGPeter Zhu
Hashes are no longer allocated on the transient heap.
2023-05-23Fix crash when replacing ST hash with AR hashPeter Zhu
With VWA, AR hashes are much larger than ST hashes. Hash#replace attempts to directly copy the contents of AR hashes into ST hashes so there will be memory corruption caused by writing past the end of memory. This commit changes it so that if a ST hash is being replaced with an AR hash it will insert each element into the ST hash. Notes: Merged: https://github.com/ruby/ruby/pull/7846
2023-05-17Move ar_hint to ar_table_structPeter Zhu
This allows Hashes with ST tables to fit int he 80 byte size pool. Notes: Merged: https://github.com/ruby/ruby/pull/7742
2023-05-17Implement Hash ST tables on VWAPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/7742
2023-05-17Implement Hash AR tables on VWAPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/7742
2023-03-06Stop exporting symbols for MJITTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7459
2023-02-23Implement ObjectSpace::WeakKeyMap basic allocatorJean Boussier
[Feature #18498] Notes: Merged: https://github.com/ruby/ruby/pull/5570
2023-01-31Remove rb_hash_st_tablePeter Zhu
It's a duplicate of RHASH_ST_TABLE. Notes: Merged: https://github.com/ruby/ruby/pull/7211
2023-01-31Remove rb_hash_ar_tablePeter Zhu
It's dead code and duplicate of RHASH_AR_TABLE. Notes: Merged: https://github.com/ruby/ruby/pull/7211
2023-01-20Fix typo in RHASH_ST_CLEARPeter Zhu
We should be setting as.st and not as.ar.
2021-10-02Restore Hash#compare_by_identity mode [Bug #18171]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4893
2021-10-02Add rb_ident_hash_new_with_sizeNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4893
2021-09-10internal/*.h: skip doxygen卜部昌平
These contents are purely implementation details, not worth appearing in CAPI documents. [ci skip] Notes: Merged: https://github.com/ruby/ruby/pull/4815
2020-10-21Ractor.make_shareable(obj)Koichi Sasada
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. Notes: Merged: https://github.com/ruby/ruby/pull/3678
2020-08-27include/ruby/backward/2/r_cast.h: deprecate卜部昌平
Remove all usages of RCAST() so that the header file can be excluded from ruby/ruby.h's dependency. Notes: Merged: https://github.com/ruby/ruby/pull/3346
2020-08-19RHASH_EMPTY_P: convert into an inline function卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3426
2020-08-19RHASH_TBL: is now ext-only卜部昌平
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. Notes: Merged: https://github.com/ruby/ruby/pull/3426
2020-05-11sed -i 's|ruby/impl|ruby/internal|'卜部昌平
To fix build failures. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-05-11sed -i s|ruby/3|ruby/impl|g卜部昌平
This shall fix compile errors. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-04-13add #include guard hack卜部昌平
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 Notes: Merged: https://github.com/ruby/ruby/pull/3023
2020-04-08Merge pull request #2991 from shyouhei/ruby.h卜部昌平
Split ruby.h Notes: Merged-By: shyouhei <[email protected]>
2019-12-26decouple internal.h headers卜部昌平
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). Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-12-26internal/hash.h rework卜部昌平
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. Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-12-26split internal.h into files卜部昌平
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. Notes: Merged: https://github.com/ruby/ruby/pull/2711