Magnus

Results 94 comments of Magnus

With some digging, I found the place where ERTS sets a guard page for spawned threads ([ethread.c](https://github.com/erlang/otp/blob/master/erts/lib_src/pthread/ethread.c#L383)): ```c #ifdef ETHR_STACK_GUARD_SIZE (void) pthread_attr_setguardsize(&attr, ETHR_STACK_GUARD_SIZE); #endif ``` In your example, we should...

Currently, `enif_send` is only used in `Env::send()` and `OwnedEnv::send_and_clear()`. For `OwnedEnv`, we know that a failure indicates that `to_pid` is dead, as we do not send from a process here....

Thanks for the report! I can reproduce this on master (662e36b): ```diff diff --git a/rustler_tests/lib/rustler_test.ex b/rustler_tests/lib/rustler_test.ex index ca25f37..191b521 100644 --- a/rustler_tests/lib/rustler_test.ex +++ b/rustler_tests/lib/rustler_test.ex @@ -83,4 +83,6 @@ def raise_term_with_atom_error(), do:...

IIUC, this happens due to how `NifReturnable` is implemented. For `Result`, the [non-unwrapping impl](https://github.com/rusterlium/rustler/blob/master/rustler/src/codegen_runtime.rs#L22) is used, while for `NifResult`, the [unwrapping impl](https://github.com/rusterlium/rustler/blob/master/rustler/src/codegen_runtime.rs#L31) (because the `E` in `Result` is set to...

@joshuataylor thanks for the PR. Can you share the code for your benchmark?

Should be fixed by https://github.com/rusterlium/rustler/pull/483.

> What about something more similar to serde's rename? Yes, that would work. Does serde by default rename variants at all, or does it keep them as-is except when `rename`...

As this is a small change, I would do this. I am unsure how much work serde_rustler will be. Of course, rustler_serde would be the preferred way.

@hansihe @filmor Ideas how we should proceed with this PR?

> I can close this PR and re-open in the future if you want. I think we can keep the PR open and come back to it after you tried...