From 9c1e343294dbe2fdb560c07570dcae32cda1a4d8 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 22 Dec 2011 18:12:58 -0800 Subject: [PATCH] feature.pm: Add function for getting the current bundle This is for when we switch over to using hints in $^H for feature bun- dles. When $bundle_number == $hint_mask, it means that the hints in %^H apply. --- lib/feature.pm | 6 ++++++ regen/feature.pl | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/feature.pm b/lib/feature.pm index 8f9467a..2c1d526 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -290,6 +290,12 @@ bundle is automatically loaded instead. =cut +sub current_bundle { + my $bundle_number = $^H & $hint_mask; + return if $bundle_number == $hint_mask; + return $feature_bundle{@hint_bundles[$bundle_number >> $hint_shift]}; +} + sub import { my $class = shift; if (@_ == 0) { diff --git a/regen/feature.pl b/regen/feature.pl index 8e11f99..2e8e8eb 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -524,6 +524,12 @@ bundle is automatically loaded instead. =cut +sub current_bundle { + my $bundle_number = $^H & $hint_mask; + return if $bundle_number == $hint_mask; + return $feature_bundle{@hint_bundles[$bundle_number >> $hint_shift]}; +} + sub import { my $class = shift; if (@_ == 0) { -- 2.7.4