lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [16/22] lucy-clownfish git commit: Add increfs and decrefs to gen ctor glue.
Date Tue, 01 Mar 2016 03:03:24 GMT
Add increfs and decrefs to gen ctor glue.

Incref decremented args. Signal to CFBind_run_trapped when it needs to
decref some args.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/2e4d3d3e
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/2e4d3d3e
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/2e4d3d3e

Branch: refs/heads/master
Commit: 2e4d3d3e6292539af7aab6419286ebe1be90e5ba
Parents: a6068b4
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Tue Feb 2 18:48:50 2016 -0800
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Wed Feb 24 15:36:07 2016 -0800

----------------------------------------------------------------------
 compiler/src/CFCPyMethod.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2e4d3d3e/compiler/src/CFCPyMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPyMethod.c b/compiler/src/CFCPyMethod.c
index 2f6168a..ef8b152 100644
--- a/compiler/src/CFCPyMethod.c
+++ b/compiler/src/CFCPyMethod.c
@@ -523,6 +523,8 @@ char*
 CFCPyMethod_constructor_wrapper(CFCFunction *init_func, CFCClass *invoker) {
     CFCParamList *param_list  = CFCFunction_get_param_list(init_func);
     char *decs       = S_gen_decs(param_list, 1);
+    char *increfs    = S_gen_arg_increfs(param_list, 1);
+    char *decrefs    = S_gen_decrefs(param_list, 1);
     const char *struct_sym = CFCClass_full_struct_sym(invoker);
     char *error = NULL;
     char *arg_parsing = S_gen_arg_parsing(param_list, 1, &error);
@@ -540,12 +542,16 @@ CFCPyMethod_constructor_wrapper(CFCFunction *init_func, CFCClass *invoker)
{
         "S_%s_PY_NEW(PyTypeObject *type, PyObject *args, PyObject *kwargs) {\n"
         "%s" // decs
         "%s" // arg_parsing
+        "%s" // increfs
+        "%s" // decrefs
         "    Py_RETURN_NONE;\n"
         "}\n"
         ;
     char *wrapper = CFCUtil_sprintf(pattern, struct_sym, decs,
-                                    arg_parsing);
+                                    arg_parsing, increfs, decrefs);
 
+    FREEMEM(decrefs);
+    FREEMEM(increfs);
     FREEMEM(decs);
     FREEMEM(arg_parsing);
     return wrapper;


Mime
View raw message