Re: Access to driver memory using c#
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Sun, 23 Apr 2006 23:36:55 +0200
"Martin" <zizka@xxxxxxxxxx> wrote in message
news:1145821847.017052.205810@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Really is there no other way than unsafe and pointers?
|
| In fact in the hardware there are just input and output buffers and
| some fifos - and I need fast access to both of the types of memories. I
| need only two special types of access to the memory - large data copy
| (memcpy in C) and fast access to one address for read/write.
|
| I'm afraid that Marshal class means lots of copying thus it will slow
| down the access, am I right?
|
| Martin
|
It depends, if you need the unmanaged data to be available as a managed type
(an array of ..), you'll have to copy it somehow.
To do this in C# you have two options, or you can use unsafe code pointers,
or you move the data using Marshal.Copy.
The latter option is your best bet, it's safer, and on V2, it's actually
faster than using unsafe & pointers.
However, if you don't need the unmanaged data to be available as a managed
type, your best option in C# is to access the data directly using unsafe &
pointers.
Willy.
.
- References:
- Access to driver memory using c#
- From: Martin
- Re: Access to driver memory using c#
- From: Willy Denoyette [MVP]
- Re: Access to driver memory using c#
- From: Martin
- Access to driver memory using c#
- Prev by Date: Re: yet another change password thread
- Next by Date: Re: Predicates are awesome
- Previous by thread: Re: Access to driver memory using c#
- Next by thread: rsInvalidMIMEType warning on images when MIMEType is Image/JPEG
- Index(es):
Relevant Pages
|
Loading