[Feature #18239] Implement VWA for strings

This commit adds support for embedded strings with variable capacity and
uses Variable Width Allocation to allocate strings.
This commit is contained in:
Peter Zhu 2021-08-26 10:06:32 -04:00
parent 6374be5a81
commit a5b6598192
Notes: git 2021-10-26 02:26:49 +09:00
16 changed files with 453 additions and 172 deletions

7
ruby.c
View file

@ -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;