> Can you explain this a bit?

Many roots may be holding pointers to this object, but only some of them
may be pinning. Assume the following case for example:

void foo(String s)
{
     bar(s);
     ...
}

void bar(String s)
{
     fixed (char* p = s) { ... }
}

If both foo and bar are on the stack the callback will be called
multiple times for the string: for the argument of foo(), for the
argument of bar() and finally for the pinned variable in bar(). Only the
very last one is going to have the pinned bit set.

> Suppose we have a fixed (..) statement in the code. Will this also map
to
one of the callbacks eventually?

Yes. The case of fixed statement in the code is handled by the callback
from FJIT_eetwain.cpp.

-Jan

This posting is provided "AS IS" with no warranties, and confers no
rights.

-----Original Message-----
From: Discussion of the Rotor Shared Source CLI implementation
[mailto:[EMAIL PROTECTED] On Behalf Of Archana
Sent: Thursday, February 05, 2004 6:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET-ROTOR] about Pinning objects

Hi,

On Thu, 5 Feb 2004, Jan Kotas wrote:

> The only way to see in the current implementation whether the given
> object is pinned is by scanning all GC roots. The GC_CALL_PINNED flag
is
> going to be set in the callback for objects that are pinned.
>
You are referring to the Promote(..) call where the flags parameter
contains GC_CALL_PINNED?
initially it appeared that if an object is pinned the flags will have
the
value GC_CALL_PINNED. but when i put printfs in the code the same object
that was pinned was being called with different flag values
4,2(GC_CALL_PINNED),10.
thats what has confused me.
Can you explain this a bit?

> The handle table is not the only part of the code that can pin
objects:
> the callback from the JIT and from EE Frames can cause GC_CALL_PINNED
to
> be set as well (look for GC_CALL_PINNED in FJIT_eetwain.cpp and
> frames.cpp).
Suppose we have a fixed (..) statement in the code. Will this also map
to
one of the callbacks eventually?

Thanks
archana

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to