diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-04-11 19:26:48 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-04-11 19:26:48 +0000 |
commit | cbb1fbeae87953fd0cb732e37262675ddbb9ffdd (patch) | |
tree | 627482c26fdb242e6cc20f6dd1b55bbdccacf8bd /pp_ctl.c | |
parent | 409dfe773507bb644ee4393d7be6447672587c1d (diff) | |
download | perl-cbb1fbeae87953fd0cb732e37262675ddbb9ffdd.tar.gz |
First stab at using the pad to store the serialised hints data.
This approach is almost certainly not only wrong, but also doomed.
But it's needed to build a correct solution.
p4raw-id: //depot/perl@27768
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 20 |
1 files changed, 3 insertions, 17 deletions
@@ -3476,27 +3476,13 @@ PP(pp_entereval) SAVEFREESV(PL_compiling.cop_io); } if (PL_compiling.cop_hints) { - PL_compiling.cop_hints->refcounted_he_refcnt--; + Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints); } PL_compiling.cop_hints = PL_curcop->cop_hints; if (PL_compiling.cop_hints) { -#ifdef USE_ITHREADS - /* PL_curcop could be pointing to an optree owned by another /.*parent/ - thread. We can't manipulate the reference count of the refcounted he - there (race condition) so we have to do something less than - pleasant to keep it read only. The simplest solution seems to be to - copy their chain. We might want to cache this. - Alternatively we could add a flag to the refcounted he *we* point to - here saying "I don't own a reference count on the thing I point to", - and arrange for Perl_refcounted_he_free() to spot that. If so, we'd - still need to copy the topmost refcounted he so that we could change - its flag. So still not trivial. (Flag bits could be hung from the - shared HEK) */ - PL_compiling.cop_hints - = Perl_refcounted_he_copy(aTHX_ PL_compiling.cop_hints); -#else + HINTS_REFCNT_LOCK; PL_compiling.cop_hints->refcounted_he_refcnt++; -#endif + HINTS_REFCNT_UNLOCK; } /* special case: an eval '' executed within the DB package gets lexically * placed in the first non-DB CV rather than the current CV - this |