summaryrefslogtreecommitdiff
path: root/prism/util/pm_constant_pool.c
AgeCommit message (Collapse)Author
2025-12-05[ruby/prism] Correct constant pool bucket type logicKevin Newton
When replacing an owned constant by a different type (constant or shared) replace with the correct type instead of defaulting to shared. https://github.com/ruby/prism/commit/fbe9b131a1
2025-02-13[ruby/prism] Handle zero-sized allocation in pm_constant_id_list_init_capacityHASUMI Hitoshi
According to the calloc(3) man page, when nmemb or size is 0, `calloc()` can either return NULL or a unique pointer that can be passed to `free()`. While gcc and clang typically return a unique pointer, mruby's `mrb_calloc()` returns NULL in this case. Since `pm_constant_pool_init()` is commonly called with capacity=0 during normal operation of Prism, explicitly handle this case by setting `list->ids` to NULL when capacity is 0. This approach is portable across different calloc implementations and avoids potential issues with mruby's allocation behavior. This maintains compatibility with `free()` and `realloc()`, as passing NULL pointers to these functions is explicitly allowed by their specifications. https://github.com/ruby/prism/commit/1c32252df7
2024-05-24[ruby/prism] Remove various unused memsize infraKevin Newton
https://github.com/ruby/prism/commit/283938ed1f
2024-04-05[ruby/prism] Make the locals set switch from list to hash dynamicallyKevin Newton
https://github.com/ruby/prism/commit/c977c4c98a
2024-04-05[ruby/prism] Switch locals to use a hashKevin Newton
https://github.com/ruby/prism/commit/f38946021e
2024-03-05[DOC] fix some commentscui fliter
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-03-04[ruby/prism] Additional fix of adding `x` prefix after rebase with main branchHASUMI Hitoshi
https://github.com/ruby/prism/commit/08733438bd
2024-03-04[ruby/prism] Make alloc interface replaceableHASUMI Hitoshi
- Add `x` prefix to malloc, calloc, realloc, and free (eg: malloc -> xmalloc) - By default, they are replaced with stdlib's functions at build - You can use custom functions by defining `PRISM_CUSTOM_ALLOCATOR` macro https://github.com/ruby/prism/commit/7a878af619
2024-02-17[ruby/prism] Fix up GCC analyzerKevin Newton
https://github.com/ruby/prism/commit/2e8bc17528
2024-02-08[PRISM] Compile constant reads using opt_getconstant_pathKevin Newton
2024-02-02[ruby/prism] Provide APIs for finding value in constant poolKevin Newton
https://github.com/ruby/prism/commit/be9e2abfa3
2024-01-11[ruby/prism] Fix nested default value errorKevin Newton
https://github.com/ruby/prism/commit/ef26b283de
2023-11-01[ruby/prism] Documentation for constant poolKevin Newton
https://github.com/ruby/prism/commit/76af64eb21
2023-10-26[ruby/prism] Match existing Ruby prettyprintKevin Newton
https://github.com/ruby/prism/commit/6d8358c083
2023-10-18[ruby/prism] Bump to version 0.15.1Kevin Newton
https://github.com/ruby/prism/commit/d906a8ceba
2023-10-18[ruby/prism] Modify less of the CRuby localsKevin Newton
https://github.com/ruby/prism/commit/aca24b3a17
2023-10-18[ruby/prism] Extract out constant pool bucket bits to constantsKevin Newton
https://github.com/ruby/prism/commit/1985a9ba51
2023-10-18[ruby/prism] Provide "constant" constants, embedded in the codeKevin Newton
https://github.com/ruby/prism/commit/d469a56e7e
2023-09-27[ruby/prism] rearrange the constant pool so IDs can be used for indexingNathan Froyd
https://github.com/ruby/prism/commit/6f243de0c7
2023-09-27Sync to prism rename commitsKevin Newton
2023-09-27Rename YARP filepaths to prism filepathsKevin Newton