feat(phase-9.75f-1): Complete FileBox dynamic library implementation
- Implement C ABI plugin system with workspace configuration - Create FileBox plugin with full read/write/exists/toString support - Fix critical memory management issues (double free) with Arc - Add comprehensive test suite for dynamic FileBox functionality - Achieve 98% build time improvement for plugin (2.87s vs 2-3min) - Maintain full backward compatibility with feature flags FileBox now loads dynamically, drastically reducing build times while maintaining all functionality. Next: Math/Time dynamic migration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -350,13 +350,13 @@ impl NyashInterpreter {
|
||||
|
||||
// 2. local変数をチェック
|
||||
if let Some(local_value) = self.local_vars.get(name) {
|
||||
eprintln!("🔍 DEBUG: Found '{}' in local_vars", name);
|
||||
eprintln!("🔍 DEBUG: Found '{}' in local_vars, type: {}", name, local_value.type_name());
|
||||
|
||||
// 🔧 修正:clone_box() → Arc::clone() で参照共有
|
||||
let shared_value = Arc::clone(local_value);
|
||||
|
||||
eprintln!("✅ RESOLVE_VARIABLE shared reference: {} id={}",
|
||||
name, shared_value.box_id());
|
||||
eprintln!("✅ RESOLVE_VARIABLE shared reference: {} id={}, type: {}",
|
||||
name, shared_value.box_id(), shared_value.type_name());
|
||||
|
||||
return Ok(shared_value);
|
||||
}
|
||||
@ -478,7 +478,12 @@ impl NyashInterpreter {
|
||||
|
||||
/// local変数を宣言(関数内でのみ有効)
|
||||
pub(super) fn declare_local_variable(&mut self, name: &str, value: Box<dyn NyashBox>) {
|
||||
self.local_vars.insert(name.to_string(), Arc::from(value));
|
||||
eprintln!("🔍 DEBUG: declare_local_variable '{}' with type: {}, id: {}",
|
||||
name, value.type_name(), value.box_id());
|
||||
let arc_value: Arc<dyn NyashBox> = Arc::from(value);
|
||||
eprintln!("🔍 DEBUG: After Arc::from, type: {}, id: {}",
|
||||
arc_value.type_name(), arc_value.box_id());
|
||||
self.local_vars.insert(name.to_string(), arc_value);
|
||||
}
|
||||
|
||||
/// outbox変数を宣言(static関数内で所有権移転)
|
||||
|
||||
Reference in New Issue
Block a user