This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make opslot_slab an offset in current slab
authorDavid Mitchell <davem@iabyn.com>
Sat, 13 Jul 2019 17:43:30 +0000 (18:43 +0100)
committerDavid Mitchell <davem@iabyn.com>
Mon, 5 Aug 2019 10:29:47 +0000 (11:29 +0100)
commit17b8f3a1378b3c300c2e4ab298a8418f720a6b84
tree4bdfa2419f6c8a4429e3a23506f1de87761364f3
parentbffbea3881b5993aeb432b80f7e06740077faa0d
make opslot_slab an offset in current slab

Each OPSLOT allocated within an OPSLAB contains a pointer, opslot_slab,
which points back to the first (head) slab of the slab chain (i.e. not
necessarily to the slab which the op is contained in).

This commit changes the pointer to be a 16-bit offset from the start of
the current slab, and adds a pointer at the start of each slab which
points back to the head slab.

The mapping from an op to the head slab is now a two-step process: use
the op's slot's opslot_offset field to find the start of the current
slab, then use that slab's new opslab_head pointer to find the head
slab.

The advantage of this is that it reduces the storage per op.  (It
probably doesn't make any practical difference yet, due to alignment
issues, but that will will be sorted shortly in this branch.)
op.c
op.h