473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

__nogc

i was wonder when a __nogc varable array is created in the
a managed class is stored in the traditional c++ heap or
in the clr heap still. The reason i ask is because i read
in a book that when you create a array variable in a
managed class it's not garbage collected. so does that
mean it's but on regular heap or is it on clr but the
garbage collector don't mess with it.
Example;

__gc Myclass {

int date __gc[23];

};

Myclass test = __gc new Myclass;
Nov 16 '05 #1
1 1599
Hi Chris,
i was wonder when a __nogc varable array is created in the
a managed class is stored in the traditional c++ heap or
in the clr heap still. The reason i ask is because i read
in a book that when you create a array variable in a
managed class it's not garbage collected. so does that
mean it's but on regular heap or is it on clr but the
garbage collector don't mess with it.
Example;

__gc Myclass {

int date __gc[23];

};

Myclass test = __gc new Myclass;


The code above is invalid. I'm assuming you mean:

__gc class MyClass {

int date __nogc[23];

};

In that case, the __noc array is stored inside the GC heap inside the memory
belonging to the object of type Myclass it is defined in (it is treated as a
value object).
--
Tomas Restrepo
to****@mvps.org
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Edward Diener | last post by:
Why is there a prohibition of instantiating __value type enums and classes within __nogc classes ? After all __value types are not managed by the GC and built-in __value types, such as 'int', are...
15
by: Edward Diener | last post by:
Why is it impossible to have a __value class instance variable in a __nogc class when it is possible to have a built-in type instance variable in a __nogc class ? __value class X { int a; };...
3
by: Edward Diener | last post by:
I want to share a __nogc classes between different assemblies. For __gc classes, one only needs to declare the class public in order to be able to do this. Is there a way to share a __nogc class so...
18
by: Edward Diener | last post by:
Is the packing alignment of __nogc classes stored as part of the assembly ? I think it must as the compiler, when referencing the assembly, could not know how the original data is packed otherwise....
2
by: Dirk | last post by:
Hello I override the WndProc method of a control-derived class and want to handle the WM_NOTIFY message. The following code leads to a NMHDR pointer that points to something where all members...
1
by: Chris | last post by:
Hi, if have a __gc class with a datamember of type : a pointer to a DateTime, but I get a compiler error : __gc class Employee { public: DateTime * m_hiringDate; ==> error : cannot...
1
by: Ian Lazarus | last post by:
Hello, I tried to confirm that two different heap allocation calls were being made, i.e., one for __gc and one for __nogc. However, the addresses of the calls (as seen in disassembly) are not...
3
by: Stormy | last post by:
Can I define a template class as following #pragma unmanaged #include "mybaseclass.h" #pragma managed namespace mymanaged1 { namespace mymanaged2 { namespace myunmanaged
0
by: Marcus Kwok | last post by:
I have been reading through the ManagedExtensionsSpec.doc file and I thought something was not clear. If I have a __value class (really a __value struct but that shouldn't make a difference) and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.