https://bugzilla.novell.com/show_bug.cgi?id=335488#c1


Sebastien Pouliot <[EMAIL PROTECTED]> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
 Attachment #179564|0                                               |1
        is obsolete|                                                |




--- Comment #1 from Sebastien Pouliot <[EMAIL PROTECTED]>  2007-11-06 08:33:18 
MST ---
Created an attachment (id=182226)
 --> (https://bugzilla.novell.com/attachment.cgi?id=182226)
runtime patch

This gets us the same behavior as 1.1 and 2.0 with the sample code (added a few
C.WL):

using System;
using System.Runtime.InteropServices;

namespace TestMarshalStringToHGlobalAnsi {
        class Program {
                static void Main(string[] args)
                {
                        const int size = 4096; 
                        string s = "".PadLeft(size, '\0');

                        Console.WriteLine (s.Length);
                        IntPtr ptr = Marshal.StringToHGlobalAnsi(s);
                        string s2 = Marshal.PtrToStringAnsi (ptr);
                        Console.WriteLine (s2.Length);

                        for (int i = 0; i < size; i += 4) {
                                Marshal.WriteInt32(ptr, i, 0);
                        }

                        Marshal.FreeHGlobal(ptr);
                }
        }
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to