develooper Front page | perl.perl5.porters | Postings from November 2008

Re: Perl_linklist (was Re: modules on CPAN defining PERL_CORE)

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
November 26, 2008 08:11
Subject:
Re: Perl_linklist (was Re: modules on CPAN defining PERL_CORE)
Message ID:
20081126161058.GV49335@plum.flirble.org
On Wed, Nov 26, 2008 at 04:36:34PM +0100, Rafael Garcia-Suarez wrote:
> 2008/11/26 Nicholas Clark <nick@ccl4.org>:
> > Do we want to make that policy decision? That optree construction is private.
> 
> If it's not private, it's public somehow. I merely want to assert that
> we don't support the internal API that is used to construct and
> optimise optrees. Perl_peep() is not public either, for example. Those
> are functions that do more than optree inspection.

To my mind the most logical way to assert that we don't support something is
to make it static whenever we can. So I made the appended change.
(And then went looking for other non-public non-static functions that the
core does not need outside the file of their definition)

Nicholas Clark

Change 34918 by nicholas@nicholas-saigo on 2008/11/26 15:41:49

	"If it's not private, it's public somehow." states Rafael. The most
	reliable way I can see to keep our (unsupported) privates private is
	to make them static whenever we can.

Affected files ...

... //depot/perl/embed.fnc#633 edit
... //depot/perl/embed.h#770 edit
... //depot/perl/op.c#1026 edit
... //depot/perl/proto.h#967 edit

Differences ...

==== //depot/perl/embed.fnc#633 (text) ====

@@ -445,7 +445,7 @@
 EXp	|void	|op_clear	|NN OP* o
 Ap	|void	|op_refcnt_lock
 Ap	|void	|op_refcnt_unlock
-p	|OP*	|linklist	|NN OP* o
+s	|OP*	|linklist	|NN OP *o
 p	|OP*	|list		|NULLOK OP* o
 p	|OP*	|listkids	|NULLOK OP* o
 Apd	|void	|load_module|U32 flags|NN SV* name|NULLOK SV* ver|...

==== //depot/perl/embed.h#770 (text+w) ====

@@ -395,7 +395,7 @@
 #define op_refcnt_lock		Perl_op_refcnt_lock
 #define op_refcnt_unlock	Perl_op_refcnt_unlock
 #ifdef PERL_CORE
-#define linklist		Perl_linklist
+#define linklist		S_linklist
 #define list			Perl_list
 #define listkids		Perl_listkids
 #endif
@@ -2710,7 +2710,7 @@
 #define op_refcnt_lock()	Perl_op_refcnt_lock(aTHX)
 #define op_refcnt_unlock()	Perl_op_refcnt_unlock(aTHX)
 #ifdef PERL_CORE
-#define linklist(a)		Perl_linklist(aTHX_ a)
+#define linklist(a)		S_linklist(aTHX_ a)
 #define list(a)			Perl_list(aTHX_ a)
 #define listkids(a)		Perl_listkids(aTHX_ a)
 #endif

==== //depot/perl/op.c#1026 (text) ====

@@ -786,7 +786,7 @@
 #define LINKLIST(o) ((o)->op_next ? (o)->op_next : linklist((OP*)o))
 
 OP *
-Perl_linklist(pTHX_ OP *o)
+S_linklist(pTHX_ OP *o)
 {
     OP *first;
 

==== //depot/perl/proto.h#967 (text+w) ====

@@ -1446,7 +1446,7 @@
 
 PERL_CALLCONV void	Perl_op_refcnt_lock(pTHX);
 PERL_CALLCONV void	Perl_op_refcnt_unlock(pTHX);
-PERL_CALLCONV OP*	Perl_linklist(pTHX_ OP* o)
+STATIC OP*	S_linklist(pTHX_ OP *o)
 			__attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_LINKLIST	\
 	assert(o)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About