efl/src/bindings
Lucas Cavalcante de Sousa 117450e3fa C#: Update C# code-generation to use a new ICustomMarshaler in some string usages that were leaking
When `C` calls a function that return/has an out string and it was overwritten by `C#` inherit class the `C` portion
wasn't cleaning its copy. Now, when a `C` calls a `C#` delegate function, `Strings` that are `out` values or `return`
values use a new marshaler (specific to this case) that uses Eina short lived strings (`Eina_Slstr`) instead of
duplicating it with `strdup`, so at some point, the string passed to `C` is deleted.

To do so, a `direction_context` (a new `Context` at `generation_contexts.hh`) was created. It is only used when a C#
delegate is being called from C (so this context is only set in `function_definition.hh` and `property_definition.hh`,
where it is set to `native_to_manage` to indicate that it is a native call to a managed function).

When this `direction_context` is set and the `String` being marshaled is not marked with an `@move` tag and it is an
`out` or `return` value, the new `StringOutMarshaler` (implemented at `iwrapper.cs`) is used (instead of
`StringKeepOwnershipMarshaler`).

When marshaling a managed data to native this marshaler uses eina short lived string (`Eina_Slstr`) that will be
automatically deleted. This delete is bounded to "the loop of the current thread or until the clear function is called
explicitly" as said at `src/lib/eina/eina_slstr.h`.

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11434
2020-03-23 14:18:16 -03:00
..
cxx eolian-mono: Make Get/Set internal for generated properties 2020-02-18 16:47:38 -03:00
js all: Simplify definition of EAPI 2018-01-18 18:04:03 +09:00
luajit elua: fix error api in lua eolian bindings 2019-10-09 13:20:15 +02:00
mono C#: Update C# code-generation to use a new ICustomMarshaler in some string usages that were leaking 2020-03-23 14:18:16 -03:00
meson.build charp: Require mono bindings when using dotnet 2019-12-04 17:09:06 +01:00