c# - Is Marshal.AllocHGlobal() result deterministic? -
let's have code:
intptr native_color = marshal.allochglobal (marshal.sizeof (typeof (gdk.rgba)));
is memory of native_color initialized zeros? think yes, there of cases in i've detected not case... so, marshal.allochglobal() not deterministic?
from documentation marshal.allochglobal method (int32)
when allochglobal calls localalloc, passes lmem_fixed flag, causes allocated memory locked in place. also, allocated memory is not zero-filled.
if have seen memory returned marshal.allochglobal filled zeros, because there.
Comments
Post a Comment