From 09321be387fa470d495538b59f05bba230f15e11 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Thu, 16 Jul 2026 09:53:44 +0200 Subject: [PATCH] feat: implement `Send` for HostMemory This allows transferring this memory to other threads, and complete thread-safety if wrapped by a Mutex. Fixes #126 --- trtx/src/host_memory.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/trtx/src/host_memory.rs b/trtx/src/host_memory.rs index 27e3dfa..22fea1f 100644 --- a/trtx/src/host_memory.rs +++ b/trtx/src/host_memory.rs @@ -67,3 +67,8 @@ impl<'builder> Deref for HostMemory<'builder> { self.as_ref() } } + +/// # Safety: +/// +/// This a wrapper around C++ container on the TRT side that is safe to send to another thread +unsafe impl Send for HostMemory<'_> {}