Skip to content

Introduce mrb_ssize type for buffer size on memory; ref #4483#4835

Merged
matz merged 1 commit into
mruby:masterfrom
shuujii:introduce-mrb_ssize-type-for-buffer-size-on-memory
Nov 22, 2019
Merged

Introduce mrb_ssize type for buffer size on memory; ref #4483#4835
matz merged 1 commit into
mruby:masterfrom
shuujii:introduce-mrb_ssize-type-for-buffer-size-on-memory

Conversation

@shuujii
Copy link
Copy Markdown
Contributor

@shuujii shuujii commented Nov 21, 2019

Previously, mrb_int was used as the type that represents the buffer size
on memory, but the sizes of RString and RArray exceed 6 words when
MRB_INT64 is enabled on 32-bit CPU.

I don't think it is necessary to be able to represent the buffer size on
memory that exceeds the virtual address space. Therefore, for this purpose,
introduce mrb_ssize which doesn't exceed the sizes of mrb_int and
pointer.

I think all mrb_int used for this purpose should be changed to
mrb_ssize, but currently only the members of the structures (RString,
mrb_shared_string, RArray and mrb_shared_array) are changed.

Previously, `mrb_int` was used as the type that represents the buffer size
on memory, but the sizes of `RString` and `RArray` exceed 6 words when
`MRB_INT64` is enabled on 32-bit CPU.

I don't think it is necessary to be able to represent the buffer size on
memory that exceeds the virtual address space. Therefore, for this purpose,
introduce `mrb_ssize` which doesn't exceed the sizes of `mrb_int` and
pointer.

I think all `mrb_int` used for this purpose should be changed to
`mrb_ssize`, but currently only the members of the structures (`RString`,
`mrb_shared_string`, `RArray` and `mrb_shared_array`) are changed.
@matz matz merged commit 8bcf446 into mruby:master Nov 22, 2019
@shuujii shuujii deleted the introduce-mrb_ssize-type-for-buffer-size-on-memory branch November 24, 2019 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants