[pypy-commit] pypy gc-incminimark-pinning: update comments in rffi
groggi
noreply at buildbot.pypy.org
Wed Sep 3 10:55:34 CEST 2014
Author: Gregor Wegberg <code at gregorwegberg.com>
Branch: gc-incminimark-pinning
Changeset: r73284:f7d67105c780
Date: 2014-09-03 10:54 +0200
http://bitbucket.org/pypy/pypy/changeset/f7d67105c780/
Log: update comments in rffi
diff --git a/rpython/rtyper/lltypesystem/rffi.py b/rpython/rtyper/lltypesystem/rffi.py
--- a/rpython/rtyper/lltypesystem/rffi.py
+++ b/rpython/rtyper/lltypesystem/rffi.py
@@ -763,14 +763,13 @@
"""
Either returns a non-moving copy or performs neccessary pointer
arithmetic to return a pointer to the characters of a string if the
- string is already nonmovable. Must be followed by a
+ string is already nonmovable or could be pinned. Must be followed by a
free_nonmovingbuffer call.
First bool returned indicates if 'data' was pinned. Second bool returned
- indicates if we did a raw alloc because pinning didn't work. Bot bools
+ indicates if we did a raw alloc because pinning failed. Both bools
should never be true at the same time.
"""
- # XXX update doc string
lldata = llstrtype(data)
count = len(data)
@@ -801,7 +800,8 @@
@jit.dont_look_inside
def free_nonmovingbuffer(data, buf, is_pinned, is_raw):
"""
- Either free a non-moving buffer or keep the original storage alive.
+ Keep 'data' alive and unpin it if it was pinned ('is_pinned' is true).
+ Otherwise free the non-moving copy ('is_raw' is true).
"""
if is_pinned:
rgc.unpin(data)
More information about the pypy-commit
mailing list