[pypy-dev] PyObject_AsCharBuffer: compiler warning

2011-01-24 Thread Arnd Rechenburg
Hi,

 

When I try to use the function PyObject_AsCharBuffer I get the following
compiler warning:

warning: passing argument 2 of 'PyObject_AsCharBuffer' from incompatible
pointer type

 

By using Python it works without problems.

In Python:

int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t
*buffer_len)

 

Is there something different in pypy?

 

Regards,

Arnd

___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

Re: [pypy-dev] PyObject_AsCharBuffer: compiler warning

2011-01-24 Thread Maciej Fijalkowski
On Mon, Jan 24, 2011 at 10:38 AM, Arnd Rechenburg
arnd.rechenb...@tomtom.com wrote:
 Hi,



 When I try to use the function PyObject_AsCharBuffer I get the following
 compiler warning:

 warning: passing argument 2 of 'PyObject_AsCharBuffer' from incompatible
 pointer type



 By using Python it works without problems.

 In Python:

 int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t
 *buffer_len)



 Is there something different in pypy?



We don't have const char**, we use char** instead. It's a small
deficiency of how we do stuff now, probably fixable in the future, but
don't worry too much, it works the same way.

Cheers,
fijal
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev


[pypy-dev] Fwd: [issue10994] implementation details in sys module

2011-01-24 Thread Maciej Fijalkowski
I think this explanation what sys.getsizeof does is interesting. We
might want to have it.


-- Forwarded message --
From: Antoine Pitrou rep...@bugs.python.org
Date: Mon, Jan 24, 2011 at 4:13 PM
Subject: [issue10994] implementation details in sys module
To: fij...@gmail.com



Antoine Pitrou pit...@free.fr added the comment:

 I suppose wrt getsizeof it's more of if you provide us with a
 reasonable expectations, we can implement this other than anything
 else.

The expectation is that it returns the memory footprint of the given
object, and only it (not taking into account sharing, caching,
dependencies or anything else). For example, an instance will not count
its attribute __dict__. But a str object will count its object header
plus the string payload, if the payload is private.

Of course, you are free to tweak these semantics for the PyPy
implementation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10994
___
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev