--
In cases where we want to cut out all buffer copying across a sequence of IPC and API boundaries, we generally use shared memory. You can see this happen for resource loading, painting, and some other image data cases.
ok, so I realized it's one thing to adopt a Vector using Vector::releaseBuffer(), but I also need to go the other way (have WTF::Vector adopt a WebVector's buffer)
I can't see a way to do this right now without something like:
WebVector::releaseToVector() {
Vector v;
Vector v.release(m_size);
*(v.dataSlot()) = data.relaseBuffer()
return v;
}
(relying on some compiler optimization, but you get the idea)
Mostly I'm wary of calling Vector::dataSlot() because there are no callers right now.
Another option would be to put this into vector:
<typename U>
void adopt(U& other) {
m_size = other.size();
m_data = other.releaseBuffer();
}
(adding releaseBuffer() to WebKVector too)
Thoughts?
ok, so I realized it's one thing to adopt a Vector using Vector::releaseBuffer(), but I also need to go the other way (have WTF::Vector adopt a WebVector's buffer)I can't see a way to do this right now without something like:WebVector::releaseToVector() {Vector v;Vector v.release(m_size);*(v.dataSlot()) = data.relaseBuffer()return v;}(relying on some compiler optimization, but you get the idea)Mostly I'm wary of calling Vector::dataSlot() because there are no callers right now.Another option would be to put this into vector:<typename U>void adopt(U& other) {m_size = other.size();m_data = other.releaseBuffer();}(adding releaseBuffer() to WebKVector too)Thoughts?
--