Re: [pypy-dev] More strategies

2013-11-08 Thread Laurence Tratt
On Fri, Nov 08, 2013 at 10:19:30AM +0100, Armin Rigo wrote: > I fear a bit that *all* cases are on the clearly nonsense side of things. > I don't particularly think there is code out there that would see any > speed-ups using these cases. As Amaury pointed out this introduces > delicate correctne

Re: [pypy-dev] cffi python long

2013-11-08 Thread Armin Rigo
Hi Nathan, On Fri, Nov 8, 2013 at 4:35 PM, Amaury Forgeot d'Arc wrote: >> Is there a nicer way to pass python long ints (bigint) into C >> efficiently? It depends what the C code wants to do with it. If it's just for passing around, you can use ffi.from_handle(). If the C code expects to read

Re: [pypy-dev] cffi python long

2013-11-08 Thread Amaury Forgeot d'Arc
2013/11/8 Nathan Hurst > Is there a nicer way to pass python long ints (bigint) into C > efficiently? I'm currently cutting the value up into 64 bit chunks in > python and passing in as an unsigned long*: > > cdef("int bigInt(int n, unsigned long* x);") > > x = sum(1 << i for i in [100,200,123])

[pypy-dev] cffi python long

2013-11-08 Thread Nathan Hurst
Is there a nicer way to pass python long ints (bigint) into C efficiently? I'm currently cutting the value up into 64 bit chunks in python and passing in as an unsigned long*: cdef("int bigInt(int n, unsigned long* x);") x = sum(1 << i for i in [100,200,123]) xs = [] while x > 0: xs.append(x

Re: [pypy-dev] More strategies

2013-11-08 Thread Armin Rigo
Hi, On Fri, Nov 8, 2013 at 12:14 AM, William ML Leslie wrote: > I wonder a bit if it is worth introducing additional fast paths for > clearly nonsense (eg, string) cases, when it's the sensible case > (user-provided types that provide __eq__) that we should be optimising > for. Did you menchbark

Re: [pypy-dev] 回复: 回复: fail about resumable hashlib code under pypy

2013-11-08 Thread Maciej Fijalkowski
pypy comes with normal hashlib. it just works like cpython one. On Fri, Nov 8, 2013 at 10:55 AM, KaShining wrote: > ok. > Can i see any demo code about hashlib-pypy ?? > > > -- 原始邮件 -- > 发件人: "Maciej Fijalkowski";; > 发送时间: 2013年11月8日(星期五) 下午4:51 > 收件人: "KaShining";

[pypy-dev] ?????? ?????? fail about resumable hashlib code under pypy

2013-11-08 Thread KaShining
ok. Can i see any demo code about hashlib-pypy ?? -- -- ??: "Maciej Fijalkowski";; : 2013??11??8??(??) 4:51 ??: "KaShining"; : "pypy-dev"; : Re: ?? [pypy-dev] fail about resumable hashlib code under pypy this can

Re: [pypy-dev] 回复: fail about resumable hashlib code under pypy

2013-11-08 Thread Maciej Fijalkowski
this can work, but these days we have implemented hashlib differently., why? On Fri, Nov 8, 2013 at 10:49 AM, KaShining wrote: > Maybe this way can work: > https://bitbucket.org/pypy/pypy/src/cli-jit/pypy/lib/_hashlib.py?at=cli-jit > > > -- 原始邮件 -- > 发件人: "Maciej F

[pypy-dev] ?????? fail about resumable hashlib code under pypy

2013-11-08 Thread KaShining
Maybe this way can work: https://bitbucket.org/pypy/pypy/src/cli-jit/pypy/lib/_hashlib.py?at=cli-jit -- -- ??: "Maciej Fijalkowski";; : 2013??11??8??(??) 4:47 ??: "KaShining"; : "pypy-dev"; : Re: [pypy-dev] fail about re

Re: [pypy-dev] fail about resumable hashlib code under pypy

2013-11-08 Thread Maciej Fijalkowski
PyPy objects are not implemented like this. This is an evil and atrocious hack to get the refcount and pyobjects stuff from python level using ctypes. works only on cpython. On Fri, Nov 8, 2013 at 10:02 AM, KaShining wrote: > Here is my test.py about resumable-hashlib: > > from ctypes import * >

[pypy-dev] fail about resumable hashlib code under pypy

2013-11-08 Thread KaShining
Here is my test.py about resumable-hashlib: from ctypes import * import hashlib PyObject_HEAD = [ ('ob_refcnt', c_size_t), ('ob_type', c_void_p), ] class EVP_MD(Structure): _fields_ = [ ('type', c_int), ('pkey_type', c_int), ('md_size', c_int), ('flags