Skip to main content

rkr_frame_builder_clone

Function rkr_frame_builder_clone 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn rkr_frame_builder_clone( builder_handle: *const RKRConFrameBuilder, ) -> *mut RKRConFrameBuilder
Expand description

Cheap, copy-on-write clone of a frame builder. Returned handle owns a new ConFrameBuilder whose per-atom buffers share storage with the source via ArcArray; any subsequent mutation triggers a per-buffer copy-on-write so writes do not leak across clones.

Intended for downstream consumers (NEB image bulk allocation, trajectory snapshots) that need many builders carrying the same per-atom data without paying N copies up-front. Returns NULL on NULL input.

The caller OWNS the returned handle and MUST call free_rkr_frame_builder (or consume via rkr_frame_builder_build).

ยงSafety

builder_handle must be a valid pointer returned by rkr_frame_new (or by an earlier rkr_frame_builder_clone) and not yet freed.