At 11:01 AM +0100 6/13/04, Nicholas Clark wrote:
I'm trying to work out how to make PMCs. I'm not finding much documentation,
and I'm not sure what I'm missing. Particularly I'm trying to work out where
I'm allowed to store data, and what flags I might have to set

I'll write up something more detailed later on today, but for now:

A basic PMC appears to contain

flags
        of which 8 are private so I could use

Yes.

a data pointer
        which I can use. I am always responsible for freeing anything there(?)

No. Only if you need to take some sort of extraordinary measures.

and to do this I need to set the active destroy flag(?)

Again, only with extraordinary measures.

This flag is not the same as the high priority DOD system(?)

Nope.

Does the garbage collector ever consider this pointer?

Yes, if the right flags are set.

is_PMC_ptr is set if this pointer points to a PMC.
is_buffer_ptr is set if this pointer points to a buffer-like structure. (Such as a string)


Set them both if the pointer points to a buffer of PMCs.

Does it ever chase what it points to?

If the right flags are set (namely the two above) yes.

a pobj_t union
        which I can use.
        Given that the nature of a C union means that the floating point value
        occupies the same space as the pointer, do I need to set flags
        depending on whether the pointers point to anything?

If they point to something parrot needs to track (a buffer, string or PMC) and you want parrot to do it automatically, yes. I'm going to have to go dig for that, though, as things have changed a bit since I last looked.
--
Dan


--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to