void ArrayBufferView::setImpl(ArrayBufferView* array, unsigned byteOffset, ExceptionCode& ec)
{
    if (byteOffset > byteLength() ||
        byteOffset + array->byteLength() > byteLength() ||
        byteOffset + array->byteLength() < byteOffset) {
        // Out of range offset or overflow
        ec = INDEX_SIZE_ERR;
        return;
    }

    char* base = static_cast<char*>(baseAddress());
    memmove(base + byteOffset, array->baseAddress(), array->byteLength());
}
Example #2
0
void MachOObject::unloadSegments()
{
	::munmap(baseAddress(), uintptr_t(maxAddress()) - uintptr_t(baseAddress()));
	m_mappings.clear();
}