ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-600

TODO pondering about allocation behavior in zkpython may be removed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.3.0
    • Component/s: contrib-bindings
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      I suppose the TODO below is referring to the "path" variable which is passed in as an output variable to PyArg_ParseTuple right below. The TODO may be removed, since the code is right. Code using PyArg_ParseTuple will borrow the reference from the calling code, since there's a stack behind the call to the enclosing function (pyzoo_get_children in this case) which won't go away until the function returns.

      Index: src/contrib/zkpython/src/c/zookeeper.c
      ===================================================================
      — src/contrib/zkpython/src/c/zookeeper.c (revision 885582)
      +++ src/contrib/zkpython/src/c/zookeeper.c (working copy)
      @@ -774,8 +774,6 @@

      static PyObject *pyzoo_get_children(PyObject *self, PyObject *args)
      {

      • // TO DO: Does Python copy the string or the reference? If it's the former
      • // we should free the String_vector
        int zkhid;
        char *path;
        PyObject *watcherfn = Py_None;

        Activity

        Gustavo Niemeyer created issue -
        Patrick Hunt made changes -
        Field Original Value New Value
        Assignee Gustavo Niemeyer [ niemeyer ]
        Patrick Hunt made changes -
        Issue Type Task [ 3 ] Bug [ 1 ]
        Fix Version/s 3.3.0 [ 12313976 ]
        Affects Version/s 3.2.1 [ 12314068 ]
        Component/s contrib-bindings [ 12312860 ]
        Gustavo Niemeyer made changes -
        Attachment deallocate-vector.patch [ 12426565 ]
        Henry Robinson made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Mahadev konar made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Resolution Fixed [ 1 ]
        Patrick Hunt made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Gustavo Niemeyer
            Reporter:
            Gustavo Niemeyer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development