use of com.oracle.truffle.llvm.nodes.intrinsics.interop.LLVMTruffleManagedMalloc.ManagedMallocObject in project sulong by graalvm.
the class NativeMemSetNode method memset.
@SuppressWarnings("unused")
@Specialization(guards = { "isManagedMallocObject(object)", "value == 0" })
protected Object memset(LLVMTruffleObject object, byte value, long length) {
assert length % ADDRESS_SIZE_IN_BYTES == 0;
final ManagedMallocObject obj = (ManagedMallocObject) object.getObject();
int arrayOffset = (int) (object.getOffset() / ADDRESS_SIZE_IN_BYTES);
for (int i = 0; i < length / ADDRESS_SIZE_IN_BYTES; i++) {
obj.set(arrayOffset + i, LLVMAddress.nullPointer());
}
return null;
}
Aggregations