[pypy-svn] r18973 - in pypy/dist/pypy/translator/c: src test

afa at codespeak.net afa at codespeak.net
Tue Oct 25 21:34:26 CEST 2005


Author: afa
Date: Tue Oct 25 21:34:16 2005
New Revision: 18973

Modified:
   pypy/dist/pypy/translator/c/src/ll__socket.h
   pypy/dist/pypy/translator/c/test/test_extfunc.py
Log:
socket.getaddrinfo(): Found a way to decref a rstring, and test passes.


Modified: pypy/dist/pypy/translator/c/src/ll__socket.h
==============================================================================
--- pypy/dist/pypy/translator/c/src/ll__socket.h	(original)
+++ pypy/dist/pypy/translator/c/src/ll__socket.h	Tue Oct 25 21:34:16 2005
@@ -153,8 +153,10 @@
 					  canonname,
 					  ipaddr, // XXX AF_INET Only!
 					  ntohs(a->sin_port),0,0);
-		// XXX DECREF(canonname)
-		// XXX DECREF(ipaddr)
+#if !defined(USING_BOEHM_GC) && !defined(USING_NO_GC)
+		canonname->refcount--;
+		ipaddr->refcount--;
+#endif
 		return ret;
 	}
 }

Modified: pypy/dist/pypy/translator/c/test/test_extfunc.py
==============================================================================
--- pypy/dist/pypy/translator/c/test/test_extfunc.py	(original)
+++ pypy/dist/pypy/translator/c/test/test_extfunc.py	Tue Oct 25 21:34:16 2005
@@ -563,9 +563,6 @@
     assert res == _socket.gethostname()
 
 def test_getaddrinfo():
-    py.test.skip("In progress")
-    # XXX fails on 'assert mallocs == frees'
-    # needs a way to decref rstrings from ll__socket.h
     import pypy.module._socket.rpython.exttable   # for declare()/declaretype()
     from pypy.module._socket.rpython import rsocket
     def does_stuff(host, port):



More information about the Pypy-commit mailing list