VLink  2.3.0
A high-performance communication middleware
fast_buffer_plugin_interface.h File Reference

Vendor-independent allocation and sharing contract for zerocopy::FastBuffer. More...

#include <cstddef>
#include <cstdint>
#include "../base/plugin.h"
#include "./fast_buffer.h"
Include dependency graph for fast_buffer_plugin_interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vlink::FastBufferPluginInterface
 Supplies platform buffers without exposing a vendor runtime to VLink. More...
 

Namespaces

 

Detailed Description

Vendor-independent allocation and sharing contract for zerocopy::FastBuffer.

FastBufferPluginInterface separates native allocation and host access from the platform that allocates the storage. Implementations may use ordinary or pinned CPU memory, device memory, shared memory, DMA-BUF or virtual allocations. Unsupported allocation domains and optional operations report failure.

Operation Methods Contract
Allocation and ownership create(), release() One owned reference per result
CPU mapping map(), unmap() Explicit access/cache scope
Native API integration native_handle(), import_native() Provider-defined local object
Completion synchronize() Wait for tracked work
Payload copy copy(), copy_to_host(), copy_from_host() Synchronous completion
Descriptor transport export_handle(), import_handle() No local pointer on the wire
Descriptor size get_handle_size() Per-allocation support
Dead-owner cleanup destroy_handle() Named OS resources only
Sharing lifecycle
Publishing process Subscribing process
------------------ -------------------
pool acquire --> generation + 1
|
device/CPU writes
|
manager export -- name + generation --> manager import
| claim reader slot, check generation
| SDK import_handle()
drop reference (never waits) |
| device use or map/unmap
next acquire: purge dead readers, |
busy while live readers remain release(): SDK close, clear slot
|
final release: retire, free when the reader table is empty

A zerocopy::FastBuffer::Buffer address belongs to its local process and address space. CPU callers must use map() or copy_to_host(); a non-null device address is not proof of CPU accessibility. Native objects and numeric file descriptors likewise require provider-specific import or OS handle transfer.

Plugin registration
class MyFastBufferPlugin final : public vlink::FastBufferPluginInterface {
// Implement the allocation, access and sharing contract below.
};
VLINK_PLUGIN_DECLARE(MyFastBufferPlugin, 1, 0)
#define VLINK_PLUGIN_DECLARE(ImplementType, VersionMajor, VersionMinor)
Emits the extern "C" construction and destruction entry points exported by a plugin module.
Definition: plugin.h:406
Set VLINK_FASTBUFFER_PLUGIN before the process creates its first buffer. The interface ABI and the descriptor protocol ID are separate compatibility contracts; the latter identifies interoperable native descriptors within the core envelope.