~dexter/parrot-pkg/maverick

« back to all changes in this revision

Viewing changes to src/pmc.c

  • Committer: Piotr Roszatycki
  • Date: 2011-01-11 14:34:28 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: piotr.roszatycki@gmail.com-20110111143428-s7pa7qz38m61o4tw
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
Copyright (C) 2001-2010, Parrot Foundation.
3
 
$Id: pmc.c 48666 2010-08-26 12:42:06Z nwellnhof $
4
3
 
5
4
=head1 NAME
6
5
 
120
119
 
121
120
    PObj_gc_CLEAR(pmc);
122
121
 
123
 
    if (pmc->vtable->attr_size)
 
122
    if (pmc->vtable->attr_size && PMC_data(pmc))
124
123
        Parrot_gc_free_pmc_attributes(interp, pmc);
125
124
    else
126
125
        PMC_data(pmc) = NULL;
713
712
 
714
713
    /* Have we overflowed the table? */
715
714
    if (type_id >= interp->n_vtable_alloced)
716
 
        parrot_realloc_vtables(interp);
 
715
        Parrot_vtbl_realloc_vtables(interp);
717
716
 
718
717
    return type_id;
719
718
}
785
784
                return VTABLE_get_integer(interp, item);
786
785
        }
787
786
        else
788
 
            return Parrot_get_datatype_enum(interp, name);
 
787
            return Parrot_dt_get_datatype_enum(interp, name);
789
788
    }
790
789
}
791
790
 
906
905
        if (!vtable->_namespace) {
907
906
            /* need a namespace Hash, anchor at parent, name it */
908
907
            PMC * const ns     = Parrot_pmc_new(interp,
909
 
                    Parrot_get_ctx_HLL_type(interp, enum_class_NameSpace));
 
908
                    Parrot_hll_get_ctx_HLL_type(interp, enum_class_NameSpace));
910
909
            vtable->_namespace = ns;
911
910
 
912
911
            /* anchor at parent, aka current_namespace, that is 'parrot' */
996
995
 
997
996
    do {
998
997
        INTVAL len;
999
 
        const INTVAL idx = Parrot_str_find_index(interp, what, role, (INTVAL)pos);
 
998
        const INTVAL idx = STRING_index(interp, what, role, pos);
1000
999
 
1001
1000
        if ((idx < 0) || (idx >= length))
1002
1001
            return 0;
1004
1003
        pos = idx;
1005
1004
        len = Parrot_str_byte_length(interp, role);
1006
1005
 
1007
 
        if (pos && (Parrot_str_indexed(interp, what, pos - 1) != 32)) {
 
1006
        if (pos && (STRING_ord(interp, what, pos - 1) != 32)) {
1008
1007
            pos += len;
1009
1008
            continue;
1010
1009
        }
1011
1010
 
1012
1011
        if (pos + len < length) {
1013
1012
            pos += len;
1014
 
            if (Parrot_str_indexed(interp, what, pos) != 32)
 
1013
            if (STRING_ord(interp, what, pos) != 32)
1015
1014
                continue;
1016
1015
        }
1017
1016
 
1038
1037
 * Local variables:
1039
1038
 *   c-file-style: "parrot"
1040
1039
 * End:
1041
 
 * vim: expandtab shiftwidth=4:
 
1040
 * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
1042
1041
 */