Internals#

Native implementation of Internals

Provides internal Perl functions that manipulate SV flags.

Perl equivalent: Internals (core module, always available)

Functions#

SvREADONLY#

Query or set the readonly flag on an SV. With one argument, returns the current readonly status. With two arguments, sets or clears the flag.

my $ro = Internals::SvREADONLY($sv);      # query
Internals::SvREADONLY($sv, 1);             # make readonly
Internals::SvREADONLY($sv, 0);             # make writable

SvREFCNT#

Returns the reference count of an SV. Always returns 1 in PetaPerl (Rust uses Arc refcounting, not Perl’s SV refcount).

my $cnt = Internals::SvREFCNT($sv);

hv_clear_placeholders#

No-op. In perl5 this removes placeholder entries from restricted hashes. PetaPerl does not implement restricted hashes, so this is a silent no-op.

Internals::hv_clear_placeholders(\%hash);