[Mono-dev] Patch for a bug when using sizeof with a generic

Alexandre Mutel alexandre_mutel at yahoo.fr
Sun Feb 13 09:21:40 EST 2011


Hi All,
I would like to submit a patch for this bug: https://bugzilla.novell.com/show_bug.cgi?id=580189
I’m using sizeof(T) in the SharpDX project (A fully managed .NET DirectX API http://code.google.com/p/sharpdx/) to be able to write efficiently structured data in memory. This instruction is not supported by C# but is a valid CLI (and can be in fact generated by C++/CLI). The impacted file is mono/mono/method-to-ir.c, in the mono_method_to_ir.

Because some people are using SharpDX with Mono (and would like to use it with Unity), I found this bug (among some others) in Mono that is quite annoying to go further.

Be indulgent for this patch, as I have just entered the mono source code this afternoon, and I’m not sure the patch is enough safe/correct, as the whole generic handling is still obscure to me.

At least, this patch is solving my specific problem ,and I’m able to run SharpDX samples smoothly! :)

Also, as a very new developer, I would like to make just a remark about the building process: I’m not hugely familiar with git, but It seems that default config for line termination is “autoclr”... which is breaking autogen.sh pre-build. This was annoying, as it is not stated in the mono-compiling for windows doc

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110213/a73a2d76/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: method-to-ir_sizeofT.patch
Type: application/octet-stream
Size: 784 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110213/a73a2d76/attachment-0001.obj 


More information about the Mono-devel-list mailing list