[pypy-svn] r54402 - in pypy/branch/io-improvements/pypy/rlib: . test
fijal at codespeak.net
fijal at codespeak.net
Sun May 4 15:02:06 CEST 2008
Author: fijal
Date: Sun May 4 15:02:05 2008
New Revision: 54402
Modified:
pypy/branch/io-improvements/pypy/rlib/rgc.py
pypy/branch/io-improvements/pypy/rlib/test/test_rgc.py
Log:
Name change
Modified: pypy/branch/io-improvements/pypy/rlib/rgc.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rlib/rgc.py (original)
+++ pypy/branch/io-improvements/pypy/rlib/rgc.py Sun May 4 15:02:05 2008
@@ -233,15 +233,15 @@
hop.exception_cannot_occur()
return hop.genop(opname, vlist, resulttype = hop.r_result.lowleveltype)
-def raw_buffer_of_shape(T, init_size):
+def resizable_buffer_of_shape(T, init_size):
""" Pre-allocates structure of type T (varsized) with possibility
to reallocate it further by resize_buffer.
"""
from pypy.rpython.lltypesystem import lltype
return lltype.malloc(T, init_size)
-class RawBufferOfShapeEntry(ExtRegistryEntry):
- _about_ = raw_buffer_of_shape
+class ResizableBufferOfShapeEntry(ExtRegistryEntry):
+ _about_ = resizable_buffer_of_shape
def compute_result_annotation(self, s_T, s_init_size):
from pypy.annotation import model as annmodel
@@ -260,7 +260,7 @@
resulttype=hop.r_result.lowleveltype)
def resize_buffer(ptr, new_size):
- """ Resize raw buffer returned by raw_buffer_of_shape to new size
+ """ Resize raw buffer returned by resizable_buffer_of_shape to new size
"""
from pypy.rpython.lltypesystem import lltype
T = lltype.typeOf(ptr).TO
@@ -293,7 +293,7 @@
resulttype=hop.r_result.lowleveltype)
def finish_building_buffer(ptr):
- """ Finish building raw_buffer returned by raw_buffer_of_shape
+ """ Finish building resizable buffer returned by resizable_buffer_of_shape
"""
return ptr
Modified: pypy/branch/io-improvements/pypy/rlib/test/test_rgc.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rlib/test/test_rgc.py (original)
+++ pypy/branch/io-improvements/pypy/rlib/test/test_rgc.py Sun May 4 15:02:05 2008
@@ -37,12 +37,12 @@
assert res == True
-def test_raw_array():
+def test_resizable_buffer():
from pypy.rpython.lltypesystem.rstr import STR
from pypy.rpython.annlowlevel import hlstr
def f():
- ptr = rgc.raw_buffer_of_shape(STR, 1)
+ ptr = rgc.resizable_buffer_of_shape(STR, 1)
ptr.chars[0] = 'a'
ptr = rgc.resize_buffer(ptr, 2)
ptr.chars[1] = 'b'
More information about the Pypy-commit
mailing list