Module clone_utils

Module clone_utils 

Source
Expand description

Utilities for optimizing clone operations

This module provides simple utility functions to help optimize clone operations by using Arc sharing where appropriate.

Functionsยง

clone_shared_allocation
Clone an Arc-shared AllocationInfo (cheap operation)
optimized_clone
Optimize a clone operation by choosing between regular clone and Arc sharing
share_allocation_info
Create an Arc-shared version of AllocationInfo
share_allocation_vector
Create a shared vector of allocations
should_use_arc_sharing
Check if a type should use Arc sharing based on size and usage patterns
unshare_allocation_info
Convert Arc-shared back to regular AllocationInfo when needed