|
|
|
start date: Wed, 8 Aug 2007 17:49:19 +0300,
posted on: microsoft.public.dotnet.framework.compactframework
back
| Thread Index |
|
1
Empi
|
|
2
ctacke/ ctacke[at]opennetcf[dot]com
|
|
3
Empi
|
|
4
ctacke/ ctacke[at]opennetcf[dot]com
|
unmanaged memory
Hi,
Should I use unmanaged memory when I work with the coredll?
If not - is there no chance .net will allocate uncontinous blocks of bytes,
and the dll
will refer to a wrong address ?
Thanks.
Date:Wed, 8 Aug 2007 17:49:19 +0300
Author:
|
Re: unmanaged memory
"coredll" is really ambiguous. P/Invokes don't inherently require using
unmanaged memory, but some do. Depends on what API you're calling.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
"Empi" wrote in message
news:uH5NMtc2HHA.484@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> Should I use unmanaged memory when I work with the coredll?
> If not - is there no chance .net will allocate uncontinous blocks of
> bytes, and the dll
> will refer to a wrong address ?
>
> Thanks.
>
>
Date:Wed, 8 Aug 2007 10:10:37 -0500
Author:
|
Re: unmanaged memory
I specificallt meant I/O functions such as ReadFile and WriteFile that gets
a Byte buffer,
but more important, how do I know which one might geperdise software's
stability?
Shouldn't I - just in order to be on the safe side - always pass unmanaged
memory?
Thanks.
"<ctacke/>" <ctacke[at]opennetcf[dot]com> wrote in message
news:%23MPlJ5c2HHA.4400@TK2MSFTNGP06.phx.gbl...
> "coredll" is really ambiguous. P/Invokes don't inherently require using
> unmanaged memory, but some do. Depends on what API you're calling.
>
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Managed Code in an Embedded World
> www.OpenNETCF.com
>
>
> "Empi" wrote in message
> news:uH5NMtc2HHA.484@TK2MSFTNGP06.phx.gbl...
>> Hi,
>>
>> Should I use unmanaged memory when I work with the coredll?
>> If not - is there no chance .net will allocate uncontinous blocks of
>> bytes, and the dll
>> will refer to a wrong address ?
>>
>> Thanks.
>>
>>
>
>
Date:Wed, 8 Aug 2007 18:25:47 +0300
Author:
|
Re: unmanaged memory
ReadFIle and WriteFile are blocking calls, so the buffer you pass in can not
be moved by the GC until after the P/Invoke has returned. That means that
that specifc call is safe without manual allocation.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
"Empi" wrote in message
news:%23bCrkBd2HHA.1164@TK2MSFTNGP02.phx.gbl...
>I specificallt meant I/O functions such as ReadFile and WriteFile that gets
>a Byte buffer,
> but more important, how do I know which one might geperdise software's
> stability?
> Shouldn't I - just in order to be on the safe side - always pass unmanaged
> memory?
>
> Thanks.
>
>
>
> "<ctacke/>" <ctacke[at]opennetcf[dot]com> wrote in message
> news:%23MPlJ5c2HHA.4400@TK2MSFTNGP06.phx.gbl...
>> "coredll" is really ambiguous. P/Invokes don't inherently require using
>> unmanaged memory, but some do. Depends on what API you're calling.
>>
>>
>> --
>>
>> Chris Tacke, Embedded MVP
>> OpenNETCF Consulting
>> Managed Code in an Embedded World
>> www.OpenNETCF.com
>>
>>
>> "Empi" wrote in message
>> news:uH5NMtc2HHA.484@TK2MSFTNGP06.phx.gbl...
>>> Hi,
>>>
>>> Should I use unmanaged memory when I work with the coredll?
>>> If not - is there no chance .net will allocate uncontinous blocks of
>>> bytes, and the dll
>>> will refer to a wrong address ?
>>>
>>> Thanks.
>>>
>>>
>>
>>
>
>
Date:Wed, 8 Aug 2007 11:11:01 -0500
Author:
|
|
|