efl/src/bin/eolian_mono/eolian/mono
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
..
alias_definition.hh csharp: Add more since tags to members 2019-11-26 12:40:32 -03:00
async_function_definition.hh eolian-mono: Make Get/Set internal for generated properties 2020-02-18 16:47:38 -03:00
blacklist.hh eolian_mono: blacklist c-only internal APIs 2020-01-29 13:46:37 +09:00
culture_info.hh csharp: CA1307 Add CultureInfo to generated code. 2019-11-20 18:34:08 -03:00
documentation.hh eolian-mono: Make Get/Set internal for generated properties 2020-02-18 16:47:38 -03:00
enum_definition.hh eolian_mono: add 1 tab inside the namespace 2020-01-13 10:16:24 +09:00
events.hh eolian_mono: change property name from args to Args 2020-01-29 13:45:56 +09:00
function_declaration.hh eolian_mono: add 1 tab inside the namespace 2020-01-13 10:16:24 +09:00
function_definition.hh 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
function_helpers.hh eolian_mono: add 1 tab inside the namespace 2020-01-13 10:16:24 +09:00
function_pointer.hh csharp: FunctionPtr wrappers are not IDisposable 2019-11-15 00:09:29 -03:00
function_registration.hh csharp: Returning only method name iwrapper. 2019-10-24 19:25:35 -03:00
generation_contexts.hh 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
helpers.hh eolian-mono: Make Get/Set internal for generated properties 2020-02-18 16:47:38 -03:00
klass.hh eolian-mono: Make Get/Set internal for generated properties 2020-02-18 16:47:38 -03:00
logging.hh csharp: Add licensing information. 2019-10-24 10:10:56 -03:00
marshall_annotation.hh 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
marshall_type.hh csharp: Add licensing information. 2019-10-24 10:10:56 -03:00
marshall_type_impl.hh eolian_mono: make struct immutable 2020-01-28 14:46:10 +09:00
name_helpers.hh mono: Add "out" as a reserved word 2020-02-17 12:35:00 +01:00
parameter.hh eolian-mono: Make Get/Set internal for generated properties 2020-02-18 16:47:38 -03:00
part_definition.hh Revert "efl_mono: remove class ExtensionTag" 2020-01-22 14:44:08 +09:00
property_definition.hh 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
struct_definition.hh csharp: Add IntPtr to/from IEnumerable conversion for "accessor" types 2020-02-18 16:52:59 -03:00
struct_fields.hh csharp: Add IntPtr to/from IEnumerable conversion for "accessor" types 2020-02-18 16:52:59 -03:00
type.hh csharp: Add licensing information. 2019-10-24 10:10:56 -03:00
type_impl.hh eina_mono: replace eina_list and eina_array with IList 2020-01-14 17:17:05 +09:00
type_match.hh csharp: Removed duplicated call_match implementations 2019-12-10 15:05:43 -03:00
using_decl.hh csharp: Add licensing information. 2019-10-24 10:10:56 -03:00
utils.hh eolian_mono: make struct immutable 2020-01-28 14:46:10 +09:00
variable_definition.hh eolian_mono: change Constants class to static class 2019-12-20 14:27:14 +09:00