R memory handling standardisation
Replace R_SWIG_EXTERNAL and R_SWIG_OWNER with the standard equivalent macros. I can't see where these were actually used, but in case they are, equivalent backwards compatibility can be obtained using: #define R_SWIG_EXTERNAL 0 #define R_SWIG_OWNER SWIG_POINTER_OWN SWIG_MakePtr does not seem to be used within the R SWIG code base so I havn't added the above as backwards compatibility macros. There seems to be no memory management in R. I've made this change to fit in with the rest of SWIG though in preparation for an upcoming commit to use the same shared_ptr macros as is used elsewhere.
This commit is contained in:
parent
114fab31a1
commit
fcd7ecd9e2
2 changed files with 7 additions and 9 deletions
|
|
@ -637,7 +637,7 @@ String * R::createFunctionPointerHandler(SwigType *t, Node *n, int *numArgs) {
|
|||
Replaceall(tm, "$1", name);
|
||||
Replaceall(tm, "$result", "r_tmp");
|
||||
replaceRClass(tm, Getattr(p,"type"));
|
||||
Replaceall(tm,"$owner", "R_SWIG_EXTERNAL");
|
||||
Replaceall(tm,"$owner", "0");
|
||||
Delete(lstr);
|
||||
}
|
||||
|
||||
|
|
@ -697,7 +697,7 @@ String * R::createFunctionPointerHandler(SwigType *t, Node *n, int *numArgs) {
|
|||
Replaceall(tm,"$input", "r_swig_cb_data->retValue");
|
||||
Replaceall(tm,"$target", Swig_cresult_name());
|
||||
replaceRClass(tm, rettype);
|
||||
Replaceall(tm,"$owner", "R_SWIG_EXTERNAL");
|
||||
Replaceall(tm,"$owner", "0");
|
||||
Replaceall(tm,"$disown","0");
|
||||
Printf(f->code, "%s\n", tm);
|
||||
}
|
||||
|
|
@ -2062,7 +2062,7 @@ int R::functionWrapper(Node *n) {
|
|||
Replaceall(tm,"$n", pos); // The position into which to store the answer.
|
||||
Replaceall(tm,"$arg", Getattr(p, "emit:input"));
|
||||
Replaceall(tm,"$input", Getattr(p, "emit:input"));
|
||||
Replaceall(tm,"$owner", "R_SWIG_EXTERNAL");
|
||||
Replaceall(tm,"$owner", "0");
|
||||
|
||||
|
||||
Printf(outargs, "%s\n", tm);
|
||||
|
|
@ -2087,9 +2087,9 @@ int R::functionWrapper(Node *n) {
|
|||
replaceRClass(tm, retType);
|
||||
|
||||
if (GetFlag(n,"feature:new")) {
|
||||
Replaceall(tm, "$owner", "R_SWIG_OWNER");
|
||||
Replaceall(tm, "$owner", "SWIG_POINTER_OWN");
|
||||
} else {
|
||||
Replaceall(tm,"$owner", "R_SWIG_EXTERNAL");
|
||||
Replaceall(tm,"$owner", "0");
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue