| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@dmitriyse in case you wanted to review. |
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #407 +/- ##
==========================================
- Coverage 63.62% 63.38% -0.24%
==========================================
Files 61 61
Lines 5264 5277 +13
Branches 861 863 +2
==========================================
- Hits 3349 3345 -4
- Misses 1698 1713 +15
- Partials 217 219 +2
Continue to review full report at Codecov.
|
Sorry, something went wrong.
|
Expanded it to include #408 as well since its related. |
Sorry, something went wrong.
| Marshal.Copy(bStr, 0, mem, bStr.Length); | ||
| } | ||
| catch (Exception) | ||
| { |
There was a problem hiding this comment.
no exception throwing here?
Sorry, something went wrong.
There was a problem hiding this comment.
what you mean? like re-throwing the Exception? That part was meant to de-allocate the memory in case something goes wrong, otherwise keep it.
Sorry, something went wrong.
There was a problem hiding this comment.
isn't failing on Marshal.Copy need to be thrown as Exception? If not, how is this handled later?
Sorry, something went wrong.
There was a problem hiding this comment.
I'll throw the exception again.
Sorry, something went wrong.
There was a problem hiding this comment.
Added the throw in the latest commit
Sorry, something went wrong.
| return mem; | ||
| } | ||
|
|
||
| public static ICustomMarshaler GetInstance(string cookie) |
There was a problem hiding this comment.
What is the purpose of string cookie?
Sorry, something went wrong.
There was a problem hiding this comment.
Its part of the implementation of the interface. On the link below scroll down to Implementing the GetInstance Method. For our use case we don't need the cookie though but left it since its part of the implementation.
Sorry, something went wrong.
There was a problem hiding this comment.
Our old monosupport actually was an ICustomMarshaler too but it depended on mono libraries to work. It also had the same signature, except it was called s
Sorry, something went wrong.
There was a problem hiding this comment.
oh, i see on Mono: // The Utf32Marshaler was written Jonathan Pryor and has been placed in the PUBLIC DOMAIN.
Sorry, something went wrong.
There was a problem hiding this comment.
@vmuriart so is custom marshalling dependent on COM interop now?
This static method is called by the common language runtime's COM interop layer to instantiate an instance of the custom marshaler.
Sorry, something went wrong.
There was a problem hiding this comment.
No. I think that line is in reference that the COM Interop layer can call the instance. Its probably related to the whole cookie thing in which the instance returned depends on which cookie is passed.
Sorry, something went wrong.
There was a problem hiding this comment.
Why is previous Mono implemented Marshalled string not a null-terminating like you added here?
Sorry, something went wrong.
There was a problem hiding this comment.
because it didn't do the marshal at all, it passed it mono to do it. Mono itself then did it here
Sorry, something went wrong.
Useful resources https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.icustommarshaler(v=vs.110).aspx https://limbioliong.wordpress.com/2013/11/03/understanding-custom-marshaling-part-1/ https://github.com/mono/mono/blob/master/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs http://stackoverflow.com/a/33514037/5208670
Refactor PyString_FromStringAndSize Link explains why `MarshalAs(UnmanagedType.LPWStr)` or `CharSet.Unicode` don't work http://stackoverflow.com/a/25128147/5208670
Its redundant with PyUnicode_AsUnicode now that the signature is fixed between UCS2/UCS4. Apply char conversion that work on both UCS2/UCS4
This won't change during runtime.
|
I'm fine with this pull request but it is a little above my knowledge. |
Sorry, something went wrong.
|
@vmuriart somehow I completely missed the whole point of this PR. Do you know why I did not see your PR description while reviewing on github?
|
Sorry, something went wrong.
|
i dont understand you question |
Sorry, something went wrong.
|
I missed the headers of commits in this PR, e.g.:
vmuriart@e487076
I'm not sure if there is any better way to expose these headers during PR?
…On Sat, Mar 18, 2017, 11:58 AM Victor Uriarte ***@***.***> wrote:
i dont understand you question
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#407 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5W9FxuZc5GcKb49fmp_C1kYQdXZFks5rnA1MgaJpZM4MMNTo>
.
|
Sorry, something went wrong.
Sorry, something went wrong.
|
Ok, now I see. So by default the descriptions are collapsed. Thank you for the suggestion. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What does this implement/fix? Explain your changes.
Refactors conversions from Managed to Native type using ICustomMarshaler's to handle the various conversions scenarios and manage releasing unmanaged memory.
Does this close any currently open issues?
#408
Any other comments?
This doesn't need to implement Native to Managed conversions as it's not needed for the purposes of the pr.