Debian Codegraph @

pypy/module/_multiprocessing/interp_memory.py

raw symbols SCIP
1 from rpython.rtyper.lltypesystem import rffi
2
3 from pypy.interpreter.error import oefmt
4 from pypy.module.mmap.interp_mmap import W_MMap
5
6 def address_of_buffer(space, w_obj):
7 if space.config.objspace.usemodules.mmap:
8 mmap = space.interp_w(W_MMap, w_obj)
9 address = rffi.cast(rffi.SIZE_T, mmap.mmap.data)
10 return space.newtuple2(space.newint(address),
11 space.newint(mmap.mmap.size))
12 else:
13 raise oefmt(space.w_TypeError, "cannot get address of buffer")