Commit 3c28bb5
committed
Make it obvious that field count guard is for debug
This is because when `RVALUE_OVERHEAD` is positive, ie. when
`RACTOR_CHECK_MODE` is enabled and we need to store the pointer to the
owning ractor, we need to make sure there is enough space to store it.
With the previous size pools the smallest size pool was 40 bytes, this
gets expanded to 48 bytes when debug mode is on in order to make space
for this extra pointer.
because rb_obj_embedded_size(0) returns just the header with no field
space it wants to be allocated in the 40 byte slot, this gives 16 bytes
which is enough for RBasic only, but because this slot is 48 bytes in
debug mode, we get the extra space for the pointer.
When the smallest slot is 32 bytes it becomes 40 bytes in debug mode,
this causes objects with no ivars to to get allocated in this pool
because according to this calc it fits. but this doesn't leave the extra
word for the ractor pointer.
So in debug mode, we'll clamp this to 1 so that there's always enough
space for 1 extra field to force allocation into the 40/48 byte pool.1 parent 5381f0f commit 3c28bb5
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
0 commit comments