Skip to content

Conversation

alamb
Copy link

@alamb alamb commented Jul 31, 2025

It shows what is needed if we switch to using &Arc<ConfigOptions> in most places

It is technically a larger API change but I think it is eaiser to use and guides people to the correct usage

@@ -734,18 +734,13 @@ impl SessionState {
}

/// return the configuration options
pub fn config_options(&self) -> &ConfigOptions {
pub fn config_options(&self) -> &Arc<ConfigOptions> {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The major idea is to return &Arc rather and then use that directly

@@ -85,11 +85,9 @@ unsafe extern "C" fn release_fn_wrapper(config: &mut FFI_SessionConfig) {

unsafe extern "C" fn clone_fn_wrapper(config: &FFI_SessionConfig) -> FFI_SessionConfig {
let old_private_data = config.private_data as *mut SessionConfigPrivateData;
let old_config = &(*old_private_data).config;
let old_config = Arc::clone(&(*old_private_data).config);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is a good example of where it caught a deep copy of the config options which isn't necessary -- instead we can just clone the arc

@Omega359 Omega359 merged commit 2fa1b82 into Omega359:udf_config_options Aug 1, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants