Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Some PMC's Questions

0 views
Skip to first unread message

Bloves Mr

unread,
Apr 15, 2005, 3:57:36 AM4/15/05
to perl6-i...@perl.org
hi,folks.
I am reading PMC C source code and reading some document("
http://www.perl.com/pub/a/2002/01/30/pmcs.html").

Some questions:

*this PMC design have changed?
*any body offer some advice that learn PMC C source code and PMC's theory?

Thanks.
/*
p2p is a protocol or a compiler?
*/

Leopold Toetsch

unread,
Apr 15, 2005, 6:06:19 AM4/15/05
to bloves mr, perl6-i...@perl.org
Bloves Mr <blo...@gmail.com> wrote:
> hi,folks.
> I am reading PMC C source code and reading some document("
> http://www.perl.com/pub/a/2002/01/30/pmcs.html").

Despite that the text is rather old, it's remarkably valid still.

> Some questions:

> *this PMC design have changed?

The internal layout of the PMC structure has changed, yes. And it
will likely change in the future. The internals of vtable calls and PMC
structure data access is now hidden inside macros:

SELF->data => PMC_data(SELF)
SELF->cache.int_val => PMC_int_val(SELF)
$1->vtable->bet_bool() => VTABLE_get_bool(INTERP, $1)

and so on. For details you might consult include/parrot/pmc.h.

> *any body offer some advice that learn PMC C source code and PMC's theory?

Just have a look at existing PMCs in classes. Commonly used core classes
are a good begin, e.g.:

classes/integer.pmc ... the Integer PMC
classes/resizablepmcarray.pmc ... standard PMC array

or even

classes/tqueue.pmc ... experimental thread-safe queue

> Thanks.

leo

0 new messages