Re: All SV memory management code now inside the PMCs

[email protected] (Nicholas Clark) Wed, 4 May 2005 11:25:58 +0100
Newsgroups perl.ponie.dev
Message-ID <[email protected]>
On Sat, Apr 30, 2005 at 08:35:47PM +0100, Nicholas Clark wrote:
> All the SV memory management code is now contained within the PMCs.
> The perl core code now has no knowledge of how different SV types get and
> free memory, or how their internal structure is laid out.

Whilst this was strictly true as written, I realised soon after that the
actual framework code to create and destroy an SV was still in static
functions in sv.c. With this change:

http://www.nntp.perl.org/group/perl.ponie.changes

it's not any more. sv.c now has:

#define new_SV(p) (p)=MUMBLE(Parrot_PMC_new(PL_Parrot, PL_pmcname[SVt_NULL]))
#define del_SV(p) Parrot_PMC_set_pointer_intkey(PL_Parrot, MUMBLE(p), \
						Ponie_P_PINE_FOR_FJORDS, 0)

> I'm not sure which is actually best to do first. The roadmap has moving
> string and number conversion code ahead of either of these, so I'll tackle
> that first.

I think that ahead of this ponie needs:

1: Logic from sv_replace moved inside the PMC
2: sv_unglob moved inside the PMC
3: newSVrv moved inside the PMC

as all these three play unseemly games with reference counts and scalar
destruction.

Nicholas Clark