I wrote:
I would guess that it has not so much to do with ArgIterator being a
special type, but that in this instance, iterator itself is stack
allocated. Frankly, I don't think this requires documentation. We
all know that you can't return a stack allocated struct from a
function.
It's hardcoded in the compiler. If you've got the Rotor sources
installed, the check is done in TYPESYM::isSpecialByRefType().
http://dotnet.di.unipi.it/Content/sscli/docs/doxygen/csharp/symmgr_8cpp-
source.html#l02546
Regards,
Jeroen
-Original Message-
From: Frans Bouma
It's hardcoded in the compiler. If you've got the Rotor
sources installed, the check is done in TYPESYM::isSpecialByRefType().
http://dotnet.di.unipi.it/Content/sscli/docs/doxygen/csharp/sy
mmgr_8cpp-
source.html#l02546
Hmmm. I really wonder why they didn't simply add an attribute to
It gets worse. Look at the following code:
using System;
class Class1
{
static void Main(string[] args)
{
ArgIterator iter = new ArgIterator(Foo(__arglist(1, 2, 3)));
}
static RuntimeArgumentHandle Foo(__arglist)
{
return __arglist;
}
}
This is effectively the same as
Hi!
Look at the code below:
using System;
namespace IteratorTest
{
public class Test
{
public object Method()
{
ArgIterator iterator;
return iterator;
}
}
}
When I try to compile it I get :
On 6/16/2003 10:39 AM, Thomas Tomiczek wrote:
Hm, ArgIterator is a struct, so it would have to be boxed to be
returned.
Ok, so take a look at this:
using System;
namespace IteratorTest
{
public struct MyStruct
{
}
public class TestClass
{
public Object MethodOne()
ArgIterator is a special type. It contains a pointer to the stack, so it
isn't allowed to escape the current method. Otherwise, you'd have a
pointer pointing into the middle of nowhere.
Regards,
Jeroen
-Original Message-
From: Bogdan Lachendro [mailto:[EMAIL PROTECTED]
Sent:
Documentation for this anywhere?
Especially on HOW they stop the boxing to happen.
Regards
Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
-Original Message-
From: Jeroen Frijters [mailto:[EMAIL PROTECTED]
Sent: Montag, 16. Juni 2003 11:39
To: [EMAIL PROTECTED]
On 6/16/2003 11:39 AM, Jeroen Frijters wrote:
ArgIterator is a special type. It contains a pointer to the stack, so it
isn't allowed to escape the current method. Otherwise, you'd have a
pointer pointing into the middle of nowhere.
OK, I understand now, but where did you find out about this?
I think it is documented somewhere in the ECMA CLI specification. I'm
not sure, it's been a while. BTW, there is another type that also
behaves like this: System.TypedReference.
Regards,
Jeroen
-Original Message-
From: Bogdan Lachendro [mailto:[EMAIL PROTECTED]
Sent: Monday, June
ArgIterator is a special type. It contains a pointer to the stack, so
it
isn't allowed to escape the current method. Otherwise, you'd have a
pointer pointing into the middle of nowhere.
I would guess that it has not so much to do with ArgIterator being a
special type, but that in this
11 matches
Mail list logo