Re: [ADVANCED-DOTNET] Large structures

2004-05-24 Thread Brown, Peter
mes, model railroading, birds, photography) -Original Message- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma Sent: Monday, May 17, 2004 4:19 AM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Large structures > Taken > > But

Re: [ADVANCED-DOTNET] Large structures

2004-05-22 Thread Shawn A. Van Ness
Right, Srihari. If you go back and read the thread from the top (it's very long, now, you can be forgiven :) you'll see this has been our driving assumption -- that the JIT compiler would have to do some static analysis on the call-tree, to ensure that the struct's members are accessed in a read-o

Re: [ADVANCED-DOTNET] Large structures

2004-05-22 Thread Arlie Davis
Of Srihari Angaluri Sent: Friday, May 21, 2004 10:53 PM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Large structures Doesn't it alter the whole semantics of value types if the implementation is allowed to do "hidden" optimizations like these? For example, if the compiler pa

Re: [ADVANCED-DOTNET] Large structures

2004-05-21 Thread Thomas Tomiczek
04:53 > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Large structures > > Doesn't it alter the whole semantics of value types if the > implementation is allowed to do "hidden" optimizations like > these? For example, if the compiler passes the struct by >

Re: [ADVANCED-DOTNET] Large structures

2004-05-21 Thread Srihari Angaluri
Doesn't it alter the whole semantics of value types if the implementation is allowed to do "hidden" optimizations like these? For example, if the compiler passes the struct by reference after a threshold size (let's say more than 1MB), any modifications I make to the structure inside the method wil

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Jeroen Frijters
e. > However, nothing horrible can happen. > > -- arlie > > > -Original Message- > From: Unmoderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of > Jeroen Frijters > Sent: Monday, May 17, 2004 6:17 AM > To: [EMAIL PROTECTED] &

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Marsh, Drew
In the interest of putting this to sleep, I think the only people who can answer why they made the design decision to go by-val instead of by-ref is the DirectX managed wrapper team. Perhaps you can find a direct channel to them. Do any of them have a weblog? I think what we're most likely going to

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Arlie Davis
: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Jeroen Frijters Sent: Monday, May 17, 2004 6:17 AM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Large structures John Elliot wrote: > Is there any safeguard in place that could catch this type of th

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Arlie Davis
John Elliot writes: > I guess I meant 'strange' as in 'closed source, poorly > documented, "I didn't write it", etc.' (don't know much > about DirectX doco, so that's not a sledge as such). The DirectX docs are actually fairly decent. > Say for example I'm targeting the managed DirectX API, and

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Frans Bouma
to:[EMAIL PROTECTED] On Behalf Of Frans Bouma > Sent: Monday, May 17, 2004 4:19 AM > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Large structures > > > Taken > > > > But in this particular case, being heavy matrix opreations > in 3d, this > > kill

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Arlie Davis
ion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma Sent: Monday, May 17, 2004 4:57 AM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Large structures > Frans Bouma wrote: > > > > Because the DX api is a COM api, > > > > > > We

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Arlie Davis
bject: Re: [ADVANCED-DOTNET] Large structures > Taken > > But in this particular case, being heavy matrix opreations in 3d, this > kills your performance. If you want performance, write a shader and do your matrix manipulations on the GPU or call into a C++ matrix lib. I a

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Arlie Davis
by reference) and the JIT implementation should do something sensible in the real world. -- arlie -Original Message- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Shawn A. Van Ness Sent: Monday, May 17, 2004 1:29 AM To: [EMAIL PROTECTED] Subject: Re

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Arlie Davis
nmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma Sent: Monday, May 17, 2004 4:00 AM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Large structures > I think the main issue here is that teh DirectX API (which this was > about in the beginning) d

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Jeroen Frijters
John Elliot wrote: > Is there any safeguard in place that could catch this type of > thing? As long as you don't use "unsafe" code, there is no way to get in trouble with a ref to a struct (they are always local to one thread). Except, of course, by calling a native method that hangs on the point

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread John Elliot
>> Just thinking out loud, but might it have something to do >> with threading concerns? If I hand out a reference to >> something on my stack to a strange API how do I know that >> it will finish with it before my stack changes.. > >But it isn't a strange API. After all, presumably the Managed Dir

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Jeroen Frijters
John Elliot wrote: > >Now the question is, since SomeRandomBoxApi takes a pointer to a > >_D3DBOX (which is equivalent to a pointer to a Box), why pass in > >the Box by value? > > Just thinking out loud, but might it have something to do > with threading concerns? If I hand out a reference to som

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Jeroen Frijters
Frans Bouma wrote: > Ok, I see your point. > > It is indeed weird, I didn't notice that, my appologies. > If you look at Volume.LockBox() for example you see this: > > public GraphicsStream LockBox(Box box, LockFlags flags) > { > return this.LockBoxInternal(ref box, flags, 0); > } > > Indeed w

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread John Elliot
>Now the question is, since SomeRandomBoxApi takes a pointer to a >_D3DBOX (which is equivalent to a pointer to a Box), why pass in >the Box by value? Just thinking out loud, but might it have something to do with threading concerns? If I hand out a reference to something on my stack to a strange

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Frans Bouma
Ok, I see your point. It is indeed weird, I didn't notice that, my appologies. If you look at Volume.LockBox() for example you see this: public GraphicsStream LockBox(Box box, LockFlags flags) { return this.LockBoxInternal(ref box, flags, 0); } Indeed weird why the box has to be passed by valu

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Jeroen Frijters
Frans Bouma wrote: > Why is it irrelevant, if I may ask? It's irrelevant to the question that we were discussing (which was "why did MS design the Managed DirectX API like this?"). > Well, perhaps the answer lies somewhere in the reason why > D3DMATRIX is defined as: > [StructLayo

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Jeroen Frijters
Frans Bouma wrote: > Although there is one weird thing: > (and you know more on this than I do I think): the D3D structs are > redefined in these formats: > > [StructLayout(LayoutKind.Sequential, Size=24, Pack=1), > CLSCompliant(false), MiscellaneousBits(65), DebugInfoInPDB] > public struc

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Frans Bouma
> Frans Bouma wrote: > > > > Because the DX api is a COM api, > > > > > > We're talking about the *Managed* DirectX API. So your entire > > > message doesn't make any sense. > > > > Erm, that api is a wrapper around DX COM. > > I know, but that's irrelevant. Why is it irrelevan

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Frans Bouma
> Frans Bouma wrote: > > Because the DX api is a COM api, > > We're talking about the *Managed* DirectX API. So your entire > message doesn't make any sense. Although there is one weird thing: (and you know more on this than I do I think): the D3D structs are redefined in these formats:

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Jeroen Frijters
Frans Bouma wrote: > > > Because the DX api is a COM api, > > > > We're talking about the *Managed* DirectX API. So your entire > > message doesn't make any sense. > > Erm, that api is a wrapper around DX COM. I know, but that's irrelevant. > For the main logic it calls into the COM ob

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Frans Bouma
> Frans Bouma wrote: > > Because the DX api is a COM api, > > We're talking about the *Managed* DirectX API. So your entire > message doesn't make any sense. Erm, that api is a wrapper around DX COM. For the main logic it calls into the COM objects. Try f.e. to decompile the Direct3D Bas

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Jeroen Frijters
Frans Bouma wrote: > Because the DX api is a COM api, We're talking about the *Managed* DirectX API. So your entire message doesn't make any sense. Regards, Jeroen === This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be inter

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Frans Bouma
> > -Original Message- > > From: Unmoderated discussion of advanced .NET topics. > > [mailto:[EMAIL PROTECTED] On Behalf Of > Frans Bouma > > Sent: Montag, 17. Mai 2004 10:00 > > To: [EMAIL PROTECTED] > > Subject: Re: [ADVANCED-DOTNET] Large structu

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Thomas Tomiczek
> From: Unmoderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma > Sent: Montag, 17. Mai 2004 10:00 > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Large structures > > > I think the main issue here is that teh DirectX API (whic

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Frans Bouma
> I think the main issue here is that teh DirectX API (which > this was about in the beginning) does not pass the structy by ref. > > Looks like a tremendous oversight to me. > > The rest then is basically a logical extension of standard > .NET semantics (structs copied onto stack) and not per

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Thomas Tomiczek
mailto:[EMAIL PROTECTED] On Behalf Of > Reali Patrik René Celeste > Sent: Montag, 17. Mai 2004 09:35 > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Large structures > > Jeroen Frijters wrote: > > Arlie Davis wrote: > > > Or does it ever simply pass a pointe

Re: [ADVANCED-DOTNET] Large structures

2004-05-17 Thread Reali Patrik René Celeste
Jeroen Frijters wrote: > Arlie Davis wrote: > > Or does it ever simply pass a pointer to the structure? > > In theory it could do this optimization in some cases, but I > don't think > it is likely that they'll do it in practice. If you want to pass large > structures, you can always pass them by r

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Jeroen Frijters
Arlie Davis wrote: > I have a few questions for the advanced CLR people here. I > haven't been able to find any satisfactory answers elsewhere. > > Consider value types / structures in CLR, and passing them as > arguments to methods. Does the MS CLR *always* copy the entire > structure onto th

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Thomas Tomiczek
cussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of > Shawn A. Van Ness > Sent: Montag, 17. Mai 2004 07:29 > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Large structures > > > This seems like a big waste of time > > Arlie, are you conce

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Shawn A. Van Ness
> This seems like a big waste of time Arlie, are you concerned more about the time (ie, the memcpy operation) or excess growth of the stack (eg, in recursive scenarios)? Or both? I don't have the managed dx sdk handy -- is their Matrix really a valuetype? In System.Drawing.Drawing2D, it's a clas

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Arlie Davis
Vince P Sent: Sunday, May 16, 2004 2:57 PM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Large structures I'm not an expert... BUT.. I think I'm right.. If you're using C#, you can take advantage of boxing which takes a value type and implicitly turns it into a reference type.

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Thomas Tomiczek
Davis > Sent: Sonntag, 16. Mai 2004 20:51 > To: [EMAIL PROTECTED] > Subject: [ADVANCED-DOTNET] Large structures > > I have a few questions for the advanced CLR people here. I > haven't been able to find any satisfactory answers elsewhere. > > Consider value type

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Vince P
> From: Unmoderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of Arlie Davis > Sent: Sunday, 16 May, 2004 13:51 > To: [EMAIL PROTECTED] > Subject: [ADVANCED-DOTNET] Large structures > > I have a few questions for the advanced CLR people here. I >

[ADVANCED-DOTNET] Large structures

2004-05-16 Thread Arlie Davis
I have a few questions for the advanced CLR people here. I haven't been able to find any satisfactory answers elsewhere. Consider value types / structures in CLR, and passing them as arguments to methods. Does the MS CLR *always* copy the entire structure onto the stack? Or does it ever simply p