Esempio n. 1
0
def test_ll_arrayclear():
    TYPE = lltype.GcArray(lltype.Signed)
    a1 = lltype.malloc(TYPE, 10)
    for i in range(10):
        a1[i] = 100 + i
    rgc.ll_arrayclear(a1)
    assert len(a1) == 10
    for i in range(10):
        assert a1[i] == 0
Esempio n. 2
0
def test_ll_arrayclear():
    TYPE = lltype.GcArray(lltype.Signed)
    a1 = lltype.malloc(TYPE, 10)
    for i in range(10):
        a1[i] = 100 + i
    rgc.ll_arrayclear(a1)
    assert len(a1) == 10
    for i in range(10):
        assert a1[i] == 0
Esempio n. 3
0
def ll_clear_indexes(d, n):
    fun = d.lookup_function_no & FUNC_MASK
    d.lookup_function_no = fun
    if fun == FUNC_BYTE:
        rgc.ll_arrayclear(lltype.cast_opaque_ptr(DICTINDEX_BYTE, d.indexes))
    elif fun == FUNC_SHORT:
        rgc.ll_arrayclear(lltype.cast_opaque_ptr(DICTINDEX_SHORT, d.indexes))
    elif IS_64BIT and fun == FUNC_INT:
        rgc.ll_arrayclear(lltype.cast_opaque_ptr(DICTINDEX_INT, d.indexes))
    elif fun == FUNC_LONG:
        rgc.ll_arrayclear(lltype.cast_opaque_ptr(DICTINDEX_LONG, d.indexes))
    else:
        assert False
Esempio n. 4
0
def ll_clear_indexes(d, n):
    fun = d.lookup_function_no & FUNC_MASK
    d.lookup_function_no = fun
    if fun == FUNC_BYTE:
        rgc.ll_arrayclear(lltype.cast_opaque_ptr(DICTINDEX_BYTE, d.indexes))
    elif fun == FUNC_SHORT:
        rgc.ll_arrayclear(lltype.cast_opaque_ptr(DICTINDEX_SHORT, d.indexes))
    elif IS_64BIT and fun == FUNC_INT:
        rgc.ll_arrayclear(lltype.cast_opaque_ptr(DICTINDEX_INT, d.indexes))
    elif fun == FUNC_LONG:
        rgc.ll_arrayclear(lltype.cast_opaque_ptr(DICTINDEX_LONG, d.indexes))
    else:
        assert False