Skip to content

Is native resource term equal to unmanage resource in C#? #137

Answered by christiannagel
ShervanN asked this question in Q&A
Discussion options

You must be logged in to vote

Mostly yes. A native resource is always an unmanaged resource, but not necessary the other way around.

A managed resource is a resource managed by the garbage collector, an unmanaged resource is not managed by the garbage collector.

A native resource typically is allocated by using Platform Invoke, using a native API of the operating system. Because these APIs allocate native memory (using the native heap, not the managed heap), it's also an unmanaged resource.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by christiannagel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants