summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-06-13 16:19:33 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-07-13 09:27:33 -0400
commit1e7b67f73370056c7521306b9f037b6cbccf640d (patch)
tree288d284f69cea8935adf323da99f84eff2bb7707 /struct.c
parentfff4773085bd70bf14ace146388dd0b9d80f244a (diff)
[Feature #19730] Remove transient heap
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7942
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/struct.c b/struct.c
index 574c74d95c..c47d8d086b 100644
--- a/struct.c
+++ b/struct.c
@@ -18,7 +18,6 @@
#include "internal/proc.h"
#include "internal/struct.h"
#include "internal/symbol.h"
-#include "transient_heap.h"
#include "vm_core.h"
#include "builtin.h"
@@ -798,39 +797,8 @@ rb_struct_initialize(VALUE self, VALUE values)
static VALUE *
struct_heap_alloc(VALUE st, size_t len)
{
- VALUE *ptr = rb_transient_heap_alloc((VALUE)st, sizeof(VALUE) * len);
-
- if (ptr) {
- RSTRUCT_TRANSIENT_SET(st);
- return ptr;
- }
- else {
- RSTRUCT_TRANSIENT_UNSET(st);
- return ALLOC_N(VALUE, len);
- }
-}
-
-#if USE_TRANSIENT_HEAP
-void
-rb_struct_transient_heap_evacuate(VALUE obj, int promote)
-{
- if (RSTRUCT_TRANSIENT_P(obj)) {
- const VALUE *old_ptr = rb_struct_const_heap_ptr(obj);
- VALUE *new_ptr;
- long len = RSTRUCT_LEN(obj);
-
- if (promote) {
- new_ptr = ALLOC_N(VALUE, len);
- FL_UNSET_RAW(obj, RSTRUCT_TRANSIENT_FLAG);
- }
- else {
- new_ptr = struct_heap_alloc(obj, len);
- }
- MEMCPY(new_ptr, old_ptr, VALUE, len);
- RSTRUCT(obj)->as.heap.ptr = new_ptr;
- }
+ return ALLOC_N(VALUE, len);
}
-#endif
static VALUE
struct_alloc(VALUE klass)