FWIW, I've added policies to properties[1]. You can now do obj.set("a", 
somePtr, allow_raw_pointers());

[1] https://github.com/emscripten-core/emscripten/pull/24811

On Saturday, May 24, 2025 at 2:47:57 AM UTC-7 キャロウ マーク wrote:

>
>
> On May 24, 2025, at 15:15, キャロウ マーク <[email protected]> wrote:
>
> The problem must be caused by this 4.0.8 change noted in the changelog:
>
>     Embind's val now requires a pointer policy when using pointers. e.g. (val 
> v(pointer, allow_raw_pointers()).
>
> https://emscripten.org/docs/api_reference/val.h.html does not even 
> mention allow_raw_pointers. I have looked at val.h and at the commit which 
> made this change but I remain at a loss how to change my declaration, 
> below, to incorporate `allow_raw_pointers()`. 
>  
>
> val ret = val::object();
>
> Please enlighten me.
>
>
> I have found a way to fix this thanks to the rdkit project having ti fix 
> the same issue. Change from
>
>      ret.set("transcodedImage", dst);
>
> to
>
>      ret.set("transcodedImage", val(dst, allow_raw_pointers()));
>
> I have no idea if this is creating an extra copy of the TranscodedImage 
> object (dst) or not.
>
> Regards
>
>     -Mark
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/emscripten-discuss/c4693d65-68b8-4bff-a977-9613ea935845n%40googlegroups.com.

Reply via email to