Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 347 lines (238 sloc) 8.4 kB
c64e58f pmc docs update 3
Michael Scott authored
1 /*
f1c9ca5 @petdance consting pointers and localizing temp vars
petdance authored
2 Copyright (C) 2001-2011, Parrot Foundation.
c64e58f pmc docs update 3
Michael Scott authored
3
4 =head1 NAME
5
f474cd7 @bschmalhofer [perl #38235] Rename (dyn)?classes to (dyn)?pmc
bschmalhofer authored
6 src/pmc/nci.pmc - Native Call Interface
c64e58f pmc docs update 3
Michael Scott authored
7
8 =head1 DESCRIPTION
9
10 The vtable functions for the native C call functions.
11
12 =head2 Methods
13
14 =over 4
15
16 =cut
17
18 */
2a2c19b Added in code to properly do native calls to library routines loaded via
Dan Sugalski authored
19
6bdd5f9 @petdance headerizer now runs on PMC files
petdance authored
20 /* HEADERIZER HFILE: none */
21 /* HEADERIZER BEGIN: static */
e69d2a4 @petdance Made pcc_params be static. Removed unused arg from build_func. Header…
petdance authored
22 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
23
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
24 PARROT_IGNORABLE_RESULT
25 static nci_thunk_t /*@alt void@*/
26 build_func(PARROT_INTERP,
b75e23a @bacek Write barriering NCI in build_func.
bacek authored
27 ARGIN(PMC *obj),
a90f6d7 @plobsing switch ffi nci.pmc over to standard signature parser
plobsing authored
28 ARGMOD(Parrot_NCI_attributes *nci))
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
29 __attribute__nonnull__(1)
30 __attribute__nonnull__(2)
b75e23a @bacek Write barriering NCI in build_func.
bacek authored
31 __attribute__nonnull__(3)
a90f6d7 @plobsing switch ffi nci.pmc over to standard signature parser
plobsing authored
32 FUNC_MODIFIES(*nci);
33
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
34 #define ASSERT_ARGS_build_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
35 PARROT_ASSERT_ARG(interp) \
b75e23a @bacek Write barriering NCI in build_func.
bacek authored
36 , PARROT_ASSERT_ARG(obj) \
a90f6d7 @plobsing switch ffi nci.pmc over to standard signature parser
plobsing authored
37 , PARROT_ASSERT_ARG(nci))
e69d2a4 @petdance Made pcc_params be static. Removed unused arg from build_func. Header…
petdance authored
38 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
6bdd5f9 @petdance headerizer now runs on PMC files
petdance authored
39 /* HEADERIZER END: static */
40
75d67e7 @plobsing avoid rebuilding the pcc cif every call
plobsing authored
41 /*
42
b75e23a @bacek Write barriering NCI in build_func.
bacek authored
43 =item C<static nci_thunk_t build_func(PARROT_INTERP, PMC *obj,
44 Parrot_NCI_attributes *nci)>
75d67e7 @plobsing avoid rebuilding the pcc cif every call
plobsing authored
45
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
46 Actually build the NCI thunk.
75d67e7 @plobsing avoid rebuilding the pcc cif every call
plobsing authored
47
48 =cut
49
50 */
51
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
52 PARROT_IGNORABLE_RESULT
53 static nci_thunk_t
b75e23a @bacek Write barriering NCI in build_func.
bacek authored
54 build_func(PARROT_INTERP, ARGIN(PMC *obj), ARGMOD(Parrot_NCI_attributes *nci))
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
55 {
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
56 ASSERT_ARGS(build_func)
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
57
a90f6d7 @plobsing switch ffi nci.pmc over to standard signature parser
plobsing authored
58 Parrot_nci_sig_to_pcc(interp, nci->signature,
59 &nci->pcc_params_signature,
60 &nci->pcc_return_signature);
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
61
a90f6d7 @plobsing switch ffi nci.pmc over to standard signature parser
plobsing authored
62 /* Arity is length of the signature minus one (the return type). */
63 nci->arity = VTABLE_elements(interp, nci->signature) - 1;
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
64
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
65 /* Build call function. */
c74300b @plobsing make nci thunk lookup work with signature arrays, not strings
plobsing authored
66 nci->fb_info = build_call_func(interp, nci->signature);
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
67 nci->func = F2DPTR(VTABLE_get_pointer(interp, nci->fb_info));
176db42 @bacek Move WB after we changed NCI guts.
bacek authored
68 PARROT_GC_WRITE_BARRIER(interp, obj);
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
69
70 return (nci_thunk_t)nci->func;
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
71 }
72
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
73
336b07c @bacek Add 'does invokable' to all PMCs with VTABLE_invoke (except Object). …
bacek authored
74 pmclass NCI auto_attrs provides invokable {
9d723e0 @plobsing update NCI signature parsing to emit new (half year old) PCC param an…
plobsing authored
75 /* NCI thunk handling attributes */
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
76 ATTR PMC *signature; /* parsed signature */
77 ATTR void *func; /* function pointer to call */
78 ATTR PMC *fb_info; /* frame-builder info */
79 ATTR void *orig_func; /* pointer to wrapped function */
0c5f9c3 GSoC: The majority of my NCI changes in 1 commit.
John Harrison authored
80
9d723e0 @plobsing update NCI signature parsing to emit new (half year old) PCC param an…
plobsing authored
81 /* Parrot Sub-ish attributes */
82 ATTR STRING *pcc_params_signature;
83 ATTR STRING *pcc_return_signature;
2d5eeb8 @plobsing eliminate some unnecessary attributes
plobsing authored
84 ATTR INTVAL arity;
9d723e0 @plobsing update NCI signature parsing to emit new (half year old) PCC param an…
plobsing authored
85
86 /* MMD fields */
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
87 ATTR STRING *long_signature;
88 ATTR PMC *multi_sig;
2a2c19b Added in code to properly do native calls to library routines loaded via
Dan Sugalski authored
89
c64e58f pmc docs update 3
Michael Scott authored
90 /*
91
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
92 =item C<METHOD get_multisig()>
1415cda add introspection method get_multisig
Leopold Toetsch authored
93
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
94 Return the MMD signature PMC, if any or C<PMCNULL>.
1415cda add introspection method get_multisig
Leopold Toetsch authored
95
96 =cut
97
98 */
99
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
100 METHOD get_multisig() {
26f7d7b @cotto [PMC] replace PMC_pmc_val with an ATTR in the NCI PMC
cotto authored
101 PMC *sig;
102 GET_ATTR_multi_sig(INTERP, SELF, sig);
83dd9f2 @NotFound [core] partial fix for TT #667, examples/namespace/namespace_dump.pi…
NotFound authored
103 if (PMC_IS_NULL(sig))
26f7d7b @cotto [PMC] replace PMC_pmc_val with an ATTR in the NCI PMC
cotto authored
104 sig = PMCNULL;
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
105 RETURN(PMC *sig);
1415cda add introspection method get_multisig
Leopold Toetsch authored
106 }
107
108 /*
109
c64e58f pmc docs update 3
Michael Scott authored
110 =item C<void init()>
111
112 Initializes the NCI with a C<NULL> function pointer.
113
114 =cut
115
116 */
117
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
118 VTABLE void init() {
2646951 @tewk [gsoc_nci] gsoc_nci_001 merge
tewk authored
119 PObj_custom_mark_SET(SELF);
f7fc86b nci
Leopold Toetsch authored
120 }
121
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
122 VTABLE void *get_pointer() {
123 return PARROT_NCI(SELF)->orig_func;
124 }
125
c64e58f pmc docs update 3
Michael Scott authored
126 /*
127
c5334d6 @plobsing eliminate handling of string signatures within NCI objects
plobsing authored
128 =item C<void set_pointer_keyed(PMC *key, void *func)>
c64e58f pmc docs update 3
Michael Scott authored
129
380c0ba fix NCI related DOD problem
Leopold Toetsch authored
130 Sets the specified function pointer and signature (C<*key>).
c64e58f pmc docs update 3
Michael Scott authored
131
c5334d6 @plobsing eliminate handling of string signatures within NCI objects
plobsing authored
132 =item C<void set_pointer_keyed_str(STRING *key, void *func)>
133
134 Sets the specified function pointer and siganture as described in the string C<key>.
135
c64e58f pmc docs update 3
Michael Scott authored
136 =cut
137
138 */
139
c5334d6 @plobsing eliminate handling of string signatures within NCI objects
plobsing authored
140 VTABLE void set_pointer_keyed(PMC *key, void *func) {
62e3049 @petdance consting, and fixed embedded tabs
petdance authored
141 /* Store the original function and signature. */
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
142 SET_ATTR_orig_func(INTERP, SELF, func);
c5334d6 @plobsing eliminate handling of string signatures within NCI objects
plobsing authored
143 SET_ATTR_signature(INTERP, SELF, key);
144 }
c4cd281 @chromatic [PMC] Avoided an unnecessary STRING copying and creation in NCI's
chromatic authored
145
c5334d6 @plobsing eliminate handling of string signatures within NCI objects
plobsing authored
146 VTABLE void set_pointer_keyed_str(STRING *key, void *func) {
147 SELF.set_pointer_keyed(Parrot_nci_parse_signature(INTERP, key), func);
2646951 @tewk [gsoc_nci] gsoc_nci_001 merge
tewk authored
148 }
03918bc @chromatic [PMC] Fixed a read of unitialized memory in NCI PMC reported by Valgr…
chromatic authored
149
2646951 @tewk [gsoc_nci] gsoc_nci_001 merge
tewk authored
150 /*
151
152 =item C<void mark()>
153
154 Mark any referenced strings and PMCs.
155
156 =cut
157
158 */
159 VTABLE void mark() {
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
160 if (PARROT_NCI(SELF)) {
161 Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
162
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
163 Parrot_gc_mark_PMC_alive(interp, nci_info->signature);
164 Parrot_gc_mark_PMC_alive(interp, nci_info->fb_info);
165 Parrot_gc_mark_PMC_alive(interp, nci_info->multi_sig);
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
166
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
167 Parrot_gc_mark_STRING_alive(interp, nci_info->long_signature);
168 Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_params_signature);
169 Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_return_signature);
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
170 }
171 }
172
173 /*
174
c64e58f pmc docs update 3
Michael Scott authored
175 =item C<PMC *clone()>
176
177 Creates and returns a clone of the NCI.
178
179 =cut
180
181 */
182
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
183 VTABLE PMC *clone() {
971e997 @NotFound rename pmc attributes struct from Parrot_<type> to Parrot_<type>_attr…
NotFound authored
184 Parrot_NCI_attributes * const nci_info_self = PARROT_NCI(SELF);
62e3049 @petdance consting, and fixed embedded tabs
petdance authored
185
083213a @Whiteknight start rename of pmc_new to Parrot_pmc_new
Whiteknight authored
186 PMC * const ret = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
f1c9ca5 @petdance consting pointers and localizing temp vars
petdance authored
187 Parrot_NCI_attributes * const nci_info_ret = PARROT_NCI(ret);
82c7cf6 @chromatic [PMC] Minor cleanups and tidyings.
chromatic authored
188
c64e58f pmc docs update 3
Michael Scott authored
189 /* FIXME if data is malloced (JIT/i386!) then we need
190 * the length of data here, to memcpy it
191 * ManagedStruct or Buffer?
192 */
2646951 @tewk [gsoc_nci] gsoc_nci_001 merge
tewk authored
193 nci_info_ret->func = nci_info_self->func;
3b094c7 @plobsing add NCI.fb_info for frame buffer info
plobsing authored
194 nci_info_ret->fb_info = nci_info_self->fb_info;
811a7df @cotto [PMC] make NCI PMCs use ATTRs, with one temporary workaround for i386…
cotto authored
195 nci_info_ret->orig_func = nci_info_self->orig_func;
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
196 nci_info_ret->signature = nci_info_self->signature;
2646951 @tewk [gsoc_nci] gsoc_nci_001 merge
tewk authored
197 nci_info_ret->pcc_params_signature = nci_info_self->pcc_params_signature;
9d723e0 @plobsing update NCI signature parsing to emit new (half year old) PCC param an…
plobsing authored
198 nci_info_ret->pcc_return_signature = nci_info_self->pcc_params_signature;
2646951 @tewk [gsoc_nci] gsoc_nci_001 merge
tewk authored
199 nci_info_ret->arity = nci_info_self->arity;
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
200 PObj_get_FLAGS(ret) = PObj_get_FLAGS(SELF);
82c7cf6 @chromatic [PMC] Minor cleanups and tidyings.
chromatic authored
201
c64e58f pmc docs update 3
Michael Scott authored
202 return ret;
2a2c19b Added in code to properly do native calls to library routines loaded via
Dan Sugalski authored
203 }
204
c64e58f pmc docs update 3
Michael Scott authored
205 /*
206
207 =item C<INTVAL defined()>
208
209 Returns whether the NCI is defined.
210
211 =cut
212
213 */
214
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
215 VTABLE INTVAL defined() {
776e9da @petdance consting and removing unused var
petdance authored
216 const Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
8832378 @chromatic [PMC] Delayed NCI thunk initialization until absolutely necessary. This
chromatic authored
217 return nci_info->orig_func != NULL;
2a2c19b Added in code to properly do native calls to library routines loaded via
Dan Sugalski authored
218 }
219
c64e58f pmc docs update 3
Michael Scott authored
220 /*
221
0ae5d55 @paultcochrane Patch courtesy of Steve Peters <steve at fisharerojo dot org>, his co…
paultcochrane authored
222 =item C<opcode_t *invoke(void *next)>
c64e58f pmc docs update 3
Michael Scott authored
223
8832378 @chromatic [PMC] Delayed NCI thunk initialization until absolutely necessary. This
chromatic authored
224 Calls the associated C function, returning C<*next>. If the invocant is a
225 class, the PMC arguments are shifted down.
c64e58f pmc docs update 3
Michael Scott authored
226
227 =cut
228
229 */
230
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
231 VTABLE opcode_t *invoke(void *next) {
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
232 Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
233 nci_thunk_t func;
234 PMC *fb_info;
811a7df @cotto [PMC] make NCI PMCs use ATTRs, with one temporary workaround for i386…
cotto authored
235 PMC *cont;
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
236
237 func = (nci_thunk_t)D2FPTR(nci_info->func);
238
239 if (!func) {
c64fa8d @plobsing split NCI signature parser out from nci.pmc
plobsing authored
240 /* build the thunk only when necessary */
b75e23a @bacek Write barriering NCI in build_func.
bacek authored
241 func = build_func(interp, SELF, nci_info);
82c7cf6 @chromatic [PMC] Minor cleanups and tidyings.
chromatic authored
242
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
243 if (!func)
c64fa8d @plobsing split NCI signature parser out from nci.pmc
plobsing authored
244 Parrot_ex_throw_from_c_args(INTERP, NULL,
245 EXCEPTION_INVALID_OPERATION,
246 "attempt to call NULL function");
8832378 @chromatic [PMC] Delayed NCI thunk initialization until absolutely necessary. This
chromatic authored
247 }
2646951 @tewk [gsoc_nci] gsoc_nci_001 merge
tewk authored
248
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
249 GET_ATTR_fb_info(INTERP, SELF, fb_info);
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
250
92c390d Fix tailcalls to NCI, #38724
Leopold Toetsch authored
251 cont = INTERP->current_cont;
8b188db @Whiteknight Fix for TT #1029. The return continuation was being mangled in the PI…
Whiteknight authored
252 func(INTERP, SELF, fb_info);
253
8838c7f builtins 1 - first shot
Leopold Toetsch authored
254 /*
92c390d Fix tailcalls to NCI, #38724
Leopold Toetsch authored
255 * If the NCI function was tailcalled, the return result
256 * is already passed back to the caller of this frame
257 * - see Parrot_init_ret_nci(). We therefore invoke the
258 * return continuation here, which gets rid of this frame
259 * and returns the real return address
8838c7f builtins 1 - first shot
Leopold Toetsch authored
260 */
8832378 @chromatic [PMC] Delayed NCI thunk initialization until absolutely necessary. This
chromatic authored
261 if (cont && cont != NEED_CONTINUATION
262 && (PObj_get_FLAGS(cont) & SUB_FLAG_TAILCALL)) {
540d4c3 @bacek Merge context_pmc3 branch into trunk.
bacek authored
263 cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
92c390d Fix tailcalls to NCI, #38724
Leopold Toetsch authored
264 next = VTABLE_invoke(INTERP, cont, next);
265 }
82c7cf6 @chromatic [PMC] Minor cleanups and tidyings.
chromatic authored
266
e063e49 @chromatic Continuing Parrot/C++ cleanups (Steve Peters, RT #42746).
chromatic authored
267 return (opcode_t *)next;
2a2c19b Added in code to properly do native calls to library routines loaded via
Dan Sugalski authored
268 }
380c0ba fix NCI related DOD problem
Leopold Toetsch authored
269
c64e58f pmc docs update 3
Michael Scott authored
270 /*
271
272 =item C<INTVAL get_integer()>
273
274 Returns the function pointer as an integer.
275
276 =cut
277
278 */
279
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
280 VTABLE INTVAL get_integer() {
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
281 Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
282 if (!nci_info->func)
b75e23a @bacek Write barriering NCI in build_func.
bacek authored
283 build_func(INTERP, SELF, nci_info);
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
284 return (INTVAL)nci_info->func;
3168931 Forth can now generate code for words on the fly and execute them.
Dan Sugalski authored
285 }
286
f35b03c @rubys Initial support for sort
rubys authored
287 /*
288
289 =item C<INTVAL get_bool()>
290
291 Returns the boolean value of the pointer.
292
293 =cut
294
295 */
296
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
297 VTABLE INTVAL get_bool() {
776e9da @petdance consting and removing unused var
petdance authored
298 const Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
299 return (0 != (INTVAL)nci_info->orig_func);
f35b03c @rubys Initial support for sort
rubys authored
300 }
301
6586a2c @jnthn Implement arity method on NCI PMCs, plus a test for it.
jnthn authored
302 /*
303
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
304 =item C<METHOD arity()>
6586a2c @jnthn Implement arity method on NCI PMCs, plus a test for it.
jnthn authored
305
01e804c @Util [pmc] Typo corrections
Util authored
306 Return the arity of the NCI (the number of arguments).
6586a2c @jnthn Implement arity method on NCI PMCs, plus a test for it.
jnthn authored
307
308 =cut
309
310 */
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
311 METHOD arity() {
971e997 @NotFound rename pmc attributes struct from Parrot_<type> to Parrot_<type>_attr…
NotFound authored
312 Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
313
8832378 @chromatic [PMC] Delayed NCI thunk initialization until absolutely necessary. This
chromatic authored
314 if (nci_info) {
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
315 if (!nci_info->func)
b75e23a @bacek Write barriering NCI in build_func.
bacek authored
316 build_func(INTERP, SELF, nci_info);
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
317 if (nci_info->func) {
f1c9ca5 @petdance consting pointers and localizing temp vars
petdance authored
318 const INTVAL arity = nci_info->arity;
c64fa8d @plobsing split NCI signature parser out from nci.pmc
plobsing authored
319 RETURN(INTVAL arity);
8832378 @chromatic [PMC] Delayed NCI thunk initialization until absolutely necessary. This
chromatic authored
320 }
321 }
6586a2c @jnthn Implement arity method on NCI PMCs, plus a test for it.
jnthn authored
322
8832378 @chromatic [PMC] Delayed NCI thunk initialization until absolutely necessary. This
chromatic authored
323 Parrot_ex_throw_from_c_args(INTERP, NULL,
324 EXCEPTION_INVALID_OPERATION,
325 "You cannot get the arity of an undefined NCI.");
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
326 }
2a2c19b Added in code to properly do native calls to library routines loaded via
Dan Sugalski authored
327 }
c64e58f pmc docs update 3
Michael Scott authored
328
329 /*
330
331 =back
332
333 =head1 SEE ALSO
334
1e5a8ee @plobsing eliminate use of libffi-specific nci.pmc
plobsing authored
335 F<docs/pdds/pdd03_calling_conventions.pod>.
f631eb3 @plobsing remove private2 (raw) flag from nci-ffi.pmc
plobsing authored
336
c64e58f pmc docs update 3
Michael Scott authored
337 =cut
338
339 */
340
0eb3eb3 added formatting footer and detabbed
Michael Scott authored
341 /*
342 * Local variables:
72575ae @bschmalhofer #40481: [PATCH] C-code coda in pmc files
bschmalhofer authored
343 * c-file-style: "parrot"
0eb3eb3 added formatting footer and detabbed
Michael Scott authored
344 * End:
1d7dded @plobsing update C file vim modelines
plobsing authored
345 * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
72575ae @bschmalhofer #40481: [PATCH] C-code coda in pmc files
bschmalhofer authored
346 */
Something went wrong with that request. Please try again.