~ubuntu-branches/ubuntu/raring/parrot/raring-proposed

« back to all changes in this revision

Viewing changes to src/interp/inter_create.c

  • Committer: Bazaar Package Importer
  • Author(s): Allison Randal
  • Date: 2011-07-30 18:45:03 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110730184503-34d4mprtfx6pt5h3
Tags: 3.6.0-1
* New upstream release
* debian/watch:
  - Modified regular expression to capture numbered directory name
    (patch from Dominique Dumont).
* debian/rules:
  - Split build-arch and build-indep, resolving lintian warning.
  - Update path to pbc_disassemble for manpage generation (patch
    from Dominique Dumont).
* debian/patches:
  - Added patch 02_fix_perl_interpreter_path.patch, resolving
    lintian warnings.
* debian/control:
  - Added DM-Upload-Allowed field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
 
74
74
/*
75
75
 
 
76
=item C<Parrot_Interp Parrot_new(Parrot_Interp parent)>
 
77
 
 
78
Returns a new Parrot interpreter.
 
79
 
 
80
The first created interpreter (C<parent> is C<NULL>) is the last one
 
81
to get destroyed.
 
82
 
 
83
=cut
 
84
 
 
85
*/
 
86
 
 
87
PARROT_EXPORT
 
88
PARROT_CANNOT_RETURN_NULL
 
89
PARROT_MALLOC
 
90
Parrot_Interp
 
91
Parrot_new(ARGIN_NULLOK(Parrot_Interp parent))
 
92
{
 
93
    ASSERT_ARGS(Parrot_new)
 
94
    /* inter_create.c:make_interpreter builds a new Parrot_Interp. */
 
95
    return make_interpreter(parent, PARROT_NO_FLAGS);
 
96
}
 
97
 
 
98
/*
 
99
 
 
100
=item C<void Parrot_init_stacktop(PARROT_INTERP, void *stack_top)>
 
101
 
 
102
Initializes the new interpreter when it hasn't been initialized before.
 
103
 
 
104
Additionally sets the stack top, so that Parrot objects created
 
105
in inner stack frames will be visible during GC stack walking code.
 
106
B<stack_top> should be the address of an automatic variable in the caller's
 
107
stack frame. All unanchored Parrot objects (PMCs) must live in inner stack
 
108
frames so that they are not destroyed during GC runs.
 
109
 
 
110
Use this function when you call into Parrot before entering a run loop.
 
111
 
 
112
=cut
 
113
 
 
114
*/
 
115
 
 
116
PARROT_EXPORT
 
117
void
 
118
Parrot_init_stacktop(PARROT_INTERP, ARGIN(void *stack_top))
 
119
{
 
120
    ASSERT_ARGS(Parrot_init_stacktop)
 
121
    interp->lo_var_ptr = stack_top;
 
122
    Parrot_gbl_init_world_once(interp);
 
123
}
 
124
 
 
125
/*
 
126
 
76
127
=item C<Parrot_Interp make_interpreter(Interp *parent, INTVAL flags)>
77
128
 
78
129
Create the Parrot interpreter. Allocate memory and clear the registers.
198
249
    interp->piodata = NULL;
199
250
    Parrot_io_init(interp);
200
251
 
 
252
    /* use the system time as the prng seed */
 
253
    Parrot_util_srand(Parrot_get_entropy(interp));
 
254
 
201
255
    /*
202
256
     * Set up the string subsystem
203
257
     * This also generates the constant string tables