[pcre-dev] [Bug 1209] Calling pcre_free from C# causes a mem…

Góra strony
Delete this message
Autor: Alexander Vostres
Data:  
Dla: pcre-dev
Stare tematy: [pcre-dev] [Bug 1209] New: Calling pcre_free from C# causes a memory access violation
Temat: [pcre-dev] [Bug 1209] Calling pcre_free from C# causes a memory access violation
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1209

Alexander Vostres <alexx999@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alexx999@???





--- Comment #6 from Alexander Vostres <alexx999@???> 2012-12-19 08:33:37 ---
Well, actually pcre_free works perfectly with C# if you take into account that
it's a variable (pointer to function) and not actual function.

For such cases C# has nice function Marshal.GetDelegateForFunctionPointer() and
it's even possible to use pcre_callout via
Marshal.GetFunctionPointerForDelegate().

So this issue is not a bug at all, but misunderstanding of how C# and C
interoperate (and that's pretty geeky stuff, especially if any good performance
is desired).

To help people with same issues I plan to release C# wrapper capable of working
with unmodified Windows library (and quite probably capable of working
cross-platform too as there is Mono project out there)


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email