Commit 886a7f4a authored by Matti Picus's avatar Matti Picus
Browse files

test, fix for translated realloc

--HG--
branch : cpyext-realloc
parent d046815fc8d5
......@@ -21,6 +21,8 @@ def PyObject_Malloc(space, size):
flavor='raw',
add_memory_pressure=True)
realloc = rffi.llexternal('realloc', [rffi.VOIDP, rffi.SIZE_T], rffi.VOIDP)
@cpython_api([rffi.VOIDP, size_t], rffi.VOIDP)
def PyObject_Realloc(space, ptr, size):
if not lltype.cast_ptr_to_int(ptr):
......@@ -28,7 +30,7 @@ def PyObject_Realloc(space, ptr, size):
flavor='raw',
add_memory_pressure=True)
# XXX FIXME
return lltype.nullptr(rffi.VOIDP.TO)
return realloc(ptr, size)
@cpython_api([rffi.VOIDP], lltype.Void)
def PyObject_Free(space, ptr):
......
......@@ -235,7 +235,6 @@ class AppTestObject(AppTestCpythonExtensionBase):
assert type(x) is int
assert x == -424344
@pytest.mark.skipif(True, reason='realloc not fully implemented')
def test_object_realloc(self):
module = self.import_extension('foo', [
("realloctest", "METH_NOARGS",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment