Can I avoid using the garbage collected heap?
Submitted by: AdministratorAll languages that target the runtime allow you to allocate class objects from the garbage-collected heap. This brings benefits in terms of fast allocation, and avoids the need for programmers to work out when they should explicitly 'free' each object.
The CLR also provides What are called ValueTypes-these are like classes, except that ValueType objects are allocated on the runtime stack (rather than the heap), and therefore reclaimed automatically when your code exits the procedure in which they are defined. This is how "structs" in C# operate.
Managed Extensions to C++ lets you choose where class objects are allocated. If declared as managed Classes, with the __gc keyword, then they are allocated from the garbage-collected heap. If they don't include the __gc keyword, they behave like regular C++ objects, allocated from the C++ heap, and freed explicitly with the "free" method.
Submitted by: Administrator
The CLR also provides What are called ValueTypes-these are like classes, except that ValueType objects are allocated on the runtime stack (rather than the heap), and therefore reclaimed automatically when your code exits the procedure in which they are defined. This is how "structs" in C# operate.
Managed Extensions to C++ lets you choose where class objects are allocated. If declared as managed Classes, with the __gc keyword, then they are allocated from the garbage-collected heap. If they don't include the __gc keyword, they behave like regular C++ objects, allocated from the C++ heap, and freed explicitly with the "free" method.
Submitted by: Administrator
Read Online ASP Programming Job Interview Questions And Answers
Top ASP Programming Questions
☺ | What is the difference between Querystring collection and Form collection? |
☺ | Should user input data validation occur server-side or client-side? Why? |
☺ | Where is the value-type variables allocated in the computer RAM? |
☺ | What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other? |
☺ | How can you disable the browser to view the code? |
Top Dot Net Technologies Categories
☺ | MSF Interview Questions. |
☺ | .Net Architecture Interview Questions. |
☺ | ASP.Net MVC Interview Questions. |
☺ | Entity Framework Interview Questions. |
☺ | C# (Sharp) Programming Language Interview Questions. |