|
VLink
2.3.0
A high-performance communication middleware
|
Platform-independent buffer with a Header and a pointer-free wire envelope.
更多...
命名空间 | |
| vlink | |
| vlink::zerocopy | |
Platform-independent buffer with a Header and a pointer-free wire envelope.
FastBuffer pairs sequencing metadata with a reference to CPU, device or other provider-managed storage. The first construction obtains the singleton FastBufferManager; VLINK_FASTBUFFER_PLUGIN selects a provider, while an unset or empty variable selects ordinary CPU memory.
| Operation | Payload behavior | Ownership |
|---|---|---|
create() | Allocates in the selected domain | Owns one provider reference |
Copy / deep_copy() | Copies through the provider | Owns independent storage |
shallow_copy() | No payload copy | Retains the same allocation |
Move / move_copy() | No payload copy | Transfers the reference |
| Shared deserialization | Imports a sharing descriptor | Owns one import reference |
| Host deserialization | Copies bytes into provider storage | Owns independent storage |
address() is an opaque local address, not a CPU pointer. Use map() only when supported and pair it with unmap(); device-only allocations require explicit host transfer. Copies and synchronization use the provider.Metadata view and C++ object. Pointers, ownership references and process-local device indices never travel in the envelope. Byte order follows the other zero-copy types. | Wire storage | Payload | Availability |
|---|---|---|
| Shared | Control block name and generation | Compatible provider and live source |
| Host | Complete CPU-readable bytes | No sharing descriptor required |
operator>> uses a sharing descriptor when supported, otherwise host bytes. A shared descriptor names the allocation and its generation; importing after the owner reused (FastBufferPool) or retired the allocation fails as expired, and the message is dropped. MessageParser reads and prints metadata without importing the allocation. Variable-length metadata is ordinary CPU storage, separate from the provider payload. set_metadata() copies input bytes or adopts an owned rvalue; shallow_copy() retains that metadata allocation without copying its contents.