Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add string nci argument translation and simplify nci.mark()

git-svn-id: https://svn.parrot.org/parrot/branches/gsoc_nci@49742 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit 8909275d6ae75e468c935df079a950f17057e4a2 1 parent ce7dc9f
@plobsing plobsing authored
Showing with 24 additions and 18 deletions.
  1. +12 −9 config/gen/libffi/nci-ffi.pmc.in
  2. +12 −9 src/pmc/nci.pmc
View
21 config/gen/libffi/nci-ffi.pmc.in
@@ -267,16 +267,15 @@ Mark any referenced strings and PMCs.
*/
VTABLE void mark() {
- if (PARROT_NCI(SELF)) {
- Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
+ Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
- Parrot_gc_mark_PMC_alive(interp, nci_info->fb_info);
- Parrot_gc_mark_STRING_alive(interp, nci_info->sig_str);
- Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_params_signature);
- Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_return_signature);
- Parrot_gc_mark_STRING_alive(interp, nci_info->long_signature);
- Parrot_gc_mark_PMC_alive(interp, nci_info->multi_sig);
- }
+ Parrot_gc_mark_PMC_alive(interp, nci_info->fb_info);
+ Parrot_gc_mark_PMC_alive(interp, nci_info->signature);
+ Parrot_gc_mark_STRING_alive(interp, nci_info->sig_str);
+ Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_params_signature);
+ Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_return_signature);
+ Parrot_gc_mark_STRING_alive(interp, nci_info->long_signature);
+ Parrot_gc_mark_PMC_alive(interp, nci_info->multi_sig);
}
/*
@@ -476,6 +475,10 @@ class, the PMC arguments are shifted down.
values[i] = &interp;
j_offset++;
break;
+ case enum_nci_sig_string:
+ translation_pointers[i] = *(STRING**)pcc_val[i - j_offset];
+ values[i] = &translation_pointers[i];
+ break;
case enum_nci_sig_cstring:
if (STRING_IS_NULL(*(STRING**)pcc_val[i - j_offset])) {
translation_pointers[i] = (char*) NULL;
View
21 src/pmc/nci.pmc
@@ -267,16 +267,15 @@ Mark any referenced strings and PMCs.
*/
VTABLE void mark() {
- if (PARROT_NCI(SELF)) {
- Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
+ Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
- Parrot_gc_mark_PMC_alive(interp, nci_info->fb_info);
- Parrot_gc_mark_STRING_alive(interp, nci_info->sig_str);
- Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_params_signature);
- Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_return_signature);
- Parrot_gc_mark_STRING_alive(interp, nci_info->long_signature);
- Parrot_gc_mark_PMC_alive(interp, nci_info->multi_sig);
- }
+ Parrot_gc_mark_PMC_alive(interp, nci_info->fb_info);
+ Parrot_gc_mark_PMC_alive(interp, nci_info->signature);
+ Parrot_gc_mark_STRING_alive(interp, nci_info->sig_str);
+ Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_params_signature);
+ Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_return_signature);
+ Parrot_gc_mark_STRING_alive(interp, nci_info->long_signature);
+ Parrot_gc_mark_PMC_alive(interp, nci_info->multi_sig);
}
/*
@@ -476,6 +475,10 @@ class, the PMC arguments are shifted down.
values[i] = &interp;
j_offset++;
break;
+ case enum_nci_sig_string:
+ translation_pointers[i] = *(STRING**)pcc_val[i - j_offset];
+ values[i] = &translation_pointers[i];
+ break;
case enum_nci_sig_cstring:
if (STRING_IS_NULL(*(STRING**)pcc_val[i - j_offset])) {
translation_pointers[i] = (char*) NULL;

0 comments on commit 8909275

Please sign in to comment.
Something went wrong with that request. Please try again.