🚨 Critical memory safety fix: - HostVtable was created on stack and destroyed after init - Plugin stored reference to destroyed memory → NULL pointer access - Changed to static LazyLock storage for lifetime safety ✅ Results: - Segfault completely eliminated - Plugin logging now works properly - Type info system confirmed working - Full E2E FileBox plugin operation successful 🔧 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
39 lines
1.0 KiB
TOML
39 lines
1.0 KiB
TOML
# Nyash Configuration File
|
||
# プラグインによるBox実装の置き換え設定
|
||
|
||
[plugins]
|
||
# FileBoxをプラグイン版に置き換え
|
||
FileBox = "nyash-filebox-plugin"
|
||
|
||
# 他のBoxはビルトインを使用(コメントアウト = ビルトイン)
|
||
# StringBox = "my-string-plugin"
|
||
# IntegerBox = "my-integer-plugin"
|
||
|
||
# FileBoxの型情報定義
|
||
[plugins.FileBox.methods]
|
||
# readは引数なし
|
||
read = { args = [] }
|
||
|
||
# writeは文字列をbytesとして送る
|
||
write = { args = [{ from = "string", to = "bytes" }] }
|
||
|
||
# openは2つの文字列引数
|
||
open = { args = [
|
||
{ name = "path", from = "string", to = "string" },
|
||
{ name = "mode", from = "string", to = "string" }
|
||
] }
|
||
|
||
# closeは引数なし、戻り値なし
|
||
close = { args = [] }
|
||
|
||
# existsは引数なし、戻り値はbool(将来拡張)
|
||
exists = { args = [], returns = "bool" }
|
||
|
||
[plugin_paths]
|
||
# プラグインの検索パス(デフォルト)
|
||
search_paths = [
|
||
"./plugins/*/target/release",
|
||
"./plugins/*/target/debug",
|
||
"/usr/local/lib/nyash/plugins",
|
||
"~/.nyash/plugins"
|
||
] |