questions

  • Thread starter Thread starter nahur
  • Start date Start date
N

nahur

1> can you put a value type on the HEAP ?

2> when would you use Idisposable over implementing a destrouctor

many thanks
 
nahur said:
1> can you put a value type on the HEAP ?

Value types end up on the heap if they are members of reference types
(directly or indirectly), or if they are boxed, or if they're static
members.

See http://www.pobox.com/~skeet/csharp/memory.html
2> when would you use Idisposable over implementing a destrouctor

If you have a finalizer, you should *always* implement IDisposable, so
that the resources can be released earlier and SuppressFinalize can be
called.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top