is there the real array class in ruby

dear community,

In ruby I think the Array is just a List.
Is there a real Array class in Ruby such as the one C or Java has?

ありがとう
えりな

In ruby I think the Array is just a List.
Is there a real Array class in Ruby such as the one C or Java has?

How would you define a "real" Array class?

Under the hood for a Ruby Array "a separate C array is allocated in memory to keeps pointers to each array element." [1]

Likewise, in JRuby, a [Ruby]Array has an underlying Java array. [2]

Assuming the elements are homogeneous,

[1] Looking into Array memory usage in Ruby - ivo's awfully random tech blog

[2] jruby/RubyArray.java at master · jruby/jruby · GitHub

ありがとう

いつでもどうぞ

···

"Yamadaえりな" <yamoerina@gmail.com> wrote:

I would suggest you take a look at IO::Buffer from Ruby 3.1

For the record, IO::Buffer is basically an interface around mmap(2)

···

On 1/13/22 03:48, Yamadaえりな wrote:

dear community,

In ruby I think the Array is just a List.
Is there a real Array class in Ruby such as the one C or Java has?

ありがとう
えりな

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<ruby-talk list: member options login page>

I think what you mean. For the real array, you can use the Narray library.

Do Ittashi mashite,
saji

···

On Thu, Jan 13, 2022 at 11:49 AM Yamadaえりな <yamoerina@gmail.com> wrote:

dear community,

In ruby I think the Array is just a List.
Is there a real Array class in Ruby such as the one C or Java has?

ありがとう
えりな

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<ruby-talk list: member options login page>

--