This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge the implementation of B::{main_root,main_start} using ALIAS.
authorNicholas Clark <nick@ccl4.org>
Sun, 31 Oct 2010 12:42:52 +0000 (12:42 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 31 Oct 2010 12:43:30 +0000 (12:43 +0000)
ext/B/B.xs

index dca31b5..8ba2346 100644 (file)
@@ -618,8 +618,6 @@ BOOT:
 #endif
 #define B_begin_av()   PL_beginav_save
 #define B_end_av()     PL_endav
-#define B_main_root()  PL_main_root
-#define B_main_start() PL_main_start
 #define B_amagic_generation()  PL_amagic_generation
 #define B_defstash()   PL_defstash
 #define B_curstash()   PL_curstash
@@ -664,12 +662,6 @@ B_regex_padav()
 B::CV
 B_main_cv()
 
-B::OP
-B_main_root()
-
-B::OP
-B_main_start()
-
 long 
 B_amagic_generation()
 
@@ -706,6 +698,15 @@ B_diehook()
 
 MODULE = B     PACKAGE = B
 
+B::OP
+main_root()
+    ALIAS:
+       main_start = 1
+    CODE:
+       RETVAL = ix ? PL_main_start : PL_main_root;
+    OUTPUT:
+       RETVAL
+
 UV
 sub_generation()
     ALIAS: