develooper Front page | perl.perl5.porters | Postings from February 2019

[perl #133737] Build-time failures with PERL_GLOBAL_STRUCT andPERL_GLOBAL_STRUCT_PRIVATE

Thread Next
From:
Jarkko Hietaniemi via RT
Date:
February 13, 2019 19:04
Subject:
[perl #133737] Build-time failures with PERL_GLOBAL_STRUCT andPERL_GLOBAL_STRUCT_PRIVATE
Message ID:
rt-4.0.24-30176-1550084658-1359.133737-15-0@perl.org
[Karl found me gathering dust in a closet]

So yes, the global struct config was created for Symbian, which is dead 
as a dodo.  The probability of still existing Symbian phones getting 
Perl installed is extremely low.

But more generally, the config was not Symbian-specific as such.
It was  created to cover for a limitation in Symbian, and that was
"shared  libraries shall not have writeable data" (they could have
data, but only read-only).  In more modern operating systems the
writeable data sections of shared libraries are copy-on-write

The global struct is a bit misleading as terms go: what it does is that 
it pulls all the global data into a single struct, which can then be 
heap-allocated in main, and just passed around.  So it is "a struct for 
globals", not a "global" "struct".  The feature comes in two flavors,
vanilla and PRIVATE,the latter of which is really strict: it leaves
not even the global struct visible, but instead a function call
through which you can access the the struct.  (The description
I wrote (I think) for perlguts is still good.)

I still find the config useful as a cleanliness exercise: do we have a 
good enough understanding and tracking of the global data so that we
can move all of it to heap, making the shared library as "pure" as possible.
But then  again, as the creator of the feature I am biased.

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=133737

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