Le Tue, Jan 13, 2004 at 03:06:18PM -0600, le valeureux mongueur Robert Eaglestone a
dit:
> OK, I'm looking at the Parrot String documentation, and I've
> got questions. It's not like the docs are a total mess, they
> just need some fleshing out. Yeah, that's it. So here I go.
>
> Here's the page I'm looking at:
>
> http://www.parrotcode.org/docs/strings.pod.html
>
> And here are my questions. Or, rather, notes which have
> questions in them.
>
>
> * OK, I'm game, is 'String' a new thing that's been added to
> C in the last ten years? I can't find it defined anywhere;
> my brain must have gone to mush.
<STRING>, C<String> are different names for a C<struct
parrot_string_t>. Strings are garbage collected. All garbage
collected entities are accessible thru a pointer to a C<struct
pobj_t> that is an union discriminated by the member C<flags>.
Relevant code in F<include/parrot/pobj.h>:
typedef union UnionVal {
...
struct parrot_string_t * string_val;
}
typedef struct pobj_t {
UnionVal u;
Parrot_UInt flags;
}
typedef enum PObj_enum {
...
PObj_is_string_FLAG = 1 << 8,
}
But this is mostly irrelevant to the string user that will use
the API you document. If you care about internals, see more info
about garbage collection in F<docs/memory_internals.pod>.
--
stef