[pypy-dev] Request to make `makedev`, `major` and `minor` macros

Armin Rigo armin.rigo at gmail.com
Tue Dec 6 04:58:57 EST 2016


Hi John,

On 6 December 2016 at 08:20, John Zhang <John.Zhang at anu.edu.au> wrote:
> I would like to request making the definitions of
> `rpython.rlib.rposix.c_makedev/c_major/c_minor` include explicit macro
> functions, i.e., passing `macro=_MACRO_ON_POSIX` to the `rffi.llexternal`
> function.

Checked in 08ec669ddab9.  Note that the 'macro' keyword is used inside
PyPy for a single purpose: to teach the JIT that it cannot directly
write a call to the macro.  Instead it writes a call to the wrapper
generated by rffi.py.  In this case this problem was fixed by marking
the functions like "def makedev(..):" with "@jit.dont_look_inside",
which is equivalent from the point of view of the JIT.  But I have now
removed these dont_look_inside and instead added "macro=True"
arguments, as it is more natural---and also indeed more useful to
non-standard backends.  Feel free to ask if you find other similar
cases!


A bientôt,

Armin.


More information about the pypy-dev mailing list