summaryrefslogtreecommitdiff
path: root/pad.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-10-16 18:04:28 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-10-16 21:51:46 -0700
commit8771da69db30134352181c38401c7e50753a7ee8 (patch)
tree10c5d26ce8e3d86763deb53b5d0a1e68d860ea90 /pad.h
parent61c8799482f9e533904bfe832138c24064709f7d (diff)
downloadperl-8771da69db30134352181c38401c7e50753a7ee8.tar.gz
Used pad name lists for pad ids
I added pad IDs so that a pad could record which pad it closes over, to avoid problems with closures closing over the wrong pad, resulting in crashes or bizarre copies. These pad IDs were shared between clones of the same pad. In commit 9ef8d56, for efficiency I made clones of the same closure share the same pad name list. It has just occurred to be that each padlist containing the same pad name list also has the same pad ID, so we can just use the pad name list itself as the ID. This makes padlists 32 bits smaller and eliminates PL_pad_generation from the interpreter struct.
Diffstat (limited to 'pad.h')
-rw-r--r--pad.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/pad.h b/pad.h
index f65af17a78..26e183ccd8 100644
--- a/pad.h
+++ b/pad.h
@@ -31,8 +31,7 @@ typedef U64TYPE PADOFFSET;
struct padlist {
SSize_t xpadl_max; /* max index for which array has space */
PAD ** xpadl_alloc; /* pointer to beginning of array of AVs */
- U32 xpadl_id; /* Semi-unique ID, shared between clones */
- U32 xpadl_outid; /* ID of outer pad */
+ PADNAMELIST*xpadl_outid; /* Padnamelist of outer pad; used as ID */
};