A Rubyist's Walk Along the C-side (Part 4): Primitive Data Types - Peter Zhu
17-Jun-2021 1215
In the previous article, you saw how to call Ruby methods in C extensions. In this article, we’ll look at the primitive data types in the Ruby C API.In Ruby, everything is an object. However, that is not true when writing a C extension as not all types are created equal. For the more “primitive” types, there are often more efficient ways to manipulate them than to call the Ruby method. For example, there’s a more efficient way to get an element at a particular index in Ruby arrays in C than to call Array.
A Rubyist's Walk Along the C-side (Part 4): Primitive Data Types - Peter Zhu #ruby #rubydeveloper #rubyonrails #Rubyist's #Along #C-side #(Part #Primitive #Types #Peter #types https://rubyonrails.ba/link/a-rubyist-s-walk-along-the-c-side-part-4-primitive-data-types-peter-zhu