summaryrefslogtreecommitdiff
path: root/yjit.c
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2023-01-18 15:41:28 -0500
committerGitHub <noreply@github.com>2023-01-18 15:41:28 -0500
commit6bb576fe759e3ef86b2ea484313013c51c39f388 (patch)
treee8d4a3b721937842e8bac66d05e6e5e60131f9b1 /yjit.c
parent0fd5a664e743c2ea506a83c5abed145a0734e7e6 (diff)
YJIT: implement codegen for `String#empty?` (#7148)
YJIT: implement codegen for String#empty?
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit.c')
-rw-r--r--yjit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/yjit.c b/yjit.c
index db0a5f5978..a1710f9c05 100644
--- a/yjit.c
+++ b/yjit.c
@@ -37,6 +37,12 @@
#include <errno.h>
+// Field offsets for the RString struct
+enum rstring_offsets {
+ RUBY_OFFSET_RSTRING_AS_HEAP_LEN = offsetof(struct RString, as.heap.len),
+ RUBY_OFFSET_RSTRING_EMBED_LEN = offsetof(struct RString, as.embed.len),
+};
+
// We need size_t to have a known size to simplify code generation and FFI.
// TODO(alan): check this in configure.ac to fail fast on 32 bit platforms.
STATIC_ASSERT(64b_size_t, SIZE_MAX == UINT64_MAX);