We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import sync.pool pub struct Foo { page string } mut pp := pool.new_pool_processor( // array return types cause `SIGSEGV` callback: fn (mut pp pool.PoolProcessor, idx int, wid int) []Foo { page := pp.get_item[int](idx) return [Foo{page.str()}] } ) mut pp_ := pool.new_pool_processor( // non-array return types work. callback: fn (mut pp pool.PoolProcessor, idx int, wid int) &Foo { page := pp.get_item[int](idx) return &Foo{page.str()} } ) pages := []int{len: 2, init: index} // Comment out block and uncomment below for working version. pp.work_on_items(pages) res := pp.get_results[[]Foo]().map(it) dump(res) /* pp_.work_on_items(pages) res := pp_.get_results[Foo]().map(it) dump(res) */
above
works, or error.
segfault
No response
Workaround is to use another struct with an array field:
import sync.pool pub struct Foo { page string } struct Workaround { foo_arr []Foo } mut pp := pool.new_pool_processor( callback: fn (mut pp pool.PoolProcessor, idx int, wid int) &Workaround { page := pp.get_item[int](idx) res := &Workaround{ foo_arr: [Foo{page.str()}] } return res } ) pages := []int{len: 2, init: index} pp.work_on_items(pages) res := pp.get_results[[]Foo]().map(it) dump(res)
v0.4.6
linux amd64
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Reproduction Steps
above
Expected Behavior
works, or error.
Current Behavior
segfault
Possible Solution
No response
Additional Information/Context
Workaround is to use another struct with an array field:
V version
v0.4.6
Environment details (OS name and version, etc.)
linux amd64
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: