summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2021-08-26 10:06:32 -0400
committerPeter Zhu <peter@peterzhu.ca>2021-10-25 13:26:23 -0400
commita5b6598192c30187b19b892af3110a46f6a70d76 (patch)
tree4620f69a10659deb6f278b36c10ec7915194573e /ruby.c
parent6374be5a8188ff5ed2c70b9f1d76672c87a0eda7 (diff)
[Feature #18239] Implement VWA for strings
This commit adds support for embedded strings with variable capacity and uses Variable Width Allocation to allocate strings.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4933
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index ce0a96abd8..0c64d4e1ce 100644
--- a/ruby.c
+++ b/ruby.c
@@ -566,7 +566,12 @@ static VALUE
runtime_libruby_path(void)
{
#if defined _WIN32 || defined __CYGWIN__
- DWORD len = RSTRING_EMBED_LEN_MAX, ret;
+ DWORD len, ret;
+#if USE_RVARGC
+ len = 32;
+#else
+ len = RSTRING_EMBED_LEN_MAX;
+#endif
VALUE path;
VALUE wsopath = rb_str_new(0, len*sizeof(WCHAR));
WCHAR *wlibpath;