|
Hi,
could it be the "int32& pinned p" line is actually a mistake in the disassembly process, and
"int32* pinned p" is what is meant from the start? What does the disassembly show for your own code?
IMO you can force the GC to move things using a scenario like this one:
- create a class A that takes a lot of memory, say 50KB, but well below the "huge object" threshold (which is around 75KB IIRC).
- create a second class B that takes slightly more memory.
- instantiate a lot of objects A, keeping their references somewhere, say in a List, until allocating a few more would make you run out of memory.
- remove half (i.e.every second) of those objects
- now start instantiating the same number of objects from class B.
Such scenario is bound to call the GC, which will have to compact (i.e. move most of the A objects) to fill the order. You can fix your class A objects, or alternatively you can replace class A by an array of appropriate size.
|
|
|
|
|
Hi,
I'm afraid it's not a mistake of a compiler. Based on this article for example:
http://www.codeproject.com/KB/msil/ilassembly.aspx
It looks like it's just a type, now the question is, does it has some special meaning, especially when pinning objects in memory. Your method looks like it should work, I'll try it and do some tests as soon as I have few free minutes, which means now .
|
|
|
|
|
Sorry, I can't answer your question. That's the kind of question that you are only likely to get a proper answer from someone who worked at MS, and wrote portions of the CLR/C# compiler. (Do you have an MSDN license, try the MS managed forums)
All I can do is point out a reflector plugin I came across the other day: http://www.codeplex.com/reflectoraddins/Wiki/View.aspx?title=ReflectionEmitLanguage&referringTitle=Home[^]
Basically, it displays the C# code that you would need to write to output the same IL for the method.
Maybe it will help you figure out how to do what you are trying.
Good luck.
Simon
|
|
|
|
|
Well, I was hoping someone had similiar problem, that's why I asked here in first place . I've tried this plugin that you've recommened, but unfortunately without any success. This plugin just copy&paste type from exe, which produces line like that:
LocalBuilder p = gen.DeclareLocal(typeof(Int32&));
This isn't even proper c# statement hehe . So I guess, this path leads to the dead end.
|
|
|
|
|
Ravadre wrote: This isn't even proper c# statement hehe Smile. So I guess, this path leads to the dead end.
Oh well. I've not used it myself, I just remember seeing it and thinking it looked interesting while looking for a different plug-in. Sorry.
Good luck.
Simon
|
|
|
|
|
The bright side is that I didn't know that such plugin exists, and it is cool, it will be handy, that's for sure. So thanks for showing me it
|
|
|
|
|
hi,
i'm would like to write a help to an application i've built
how can integrat the windows help in my app, and use a CHM file with it
THANKS
Have Fun
Never forget it
|
|
|
|
|
Not really a C# question but ok, a quick search Here[^] brought up some promising results, but google isn't your friend.
1[^]
2[^]
3[^]
4[^]
Just to name a few from googles first page result.
|
|
|
|
|
|
|
Hi there,
actually this is a very common problem, but I do not see the solution. The situation is as follows. I have a decimal number. I want to convert it to a string without trailing zeroes, a dot as a decimal separator and a maximum of 17 digits.
Examples:
0.1234100 -> 0.12341
0.0 -> 0
0.00000196525616047 -> 0.00000196525616047 (not 1.96525616047E-06)
12123.12432 -> 12123.12432
DecimalValue.ToString("G17", nfi) gives me an exponential output.
DecimalValue.ToString("G", nfi) gives me trailing zeroes and more than 17 digits.
thanks,
Albi
modified on Wednesday, December 10, 2008 8:20 AM
|
|
|
|
|
Use DecimalValue.ToString("#.#################"); (reference here[^])
|
|
|
|
|
Oh boy, sometimes the solution is that easy and you just do not see it.
Thanks!
Albi
|
|
|
|
|
Hello everyone,
Are there API provided by Microsoft to convert video file of other types to Flash video file? If no such API provided by Microsoft, any API provided by other parties?
thanks in advance,
George
|
|
|
|
|
I'm pretty much sure that Microsoft won't have that kind of API, since Flash is Adobe's (ex-Macromedia's) proprietary file format (at least it was, I'm not sure if Adobe opened the specs)
You can check the NetFFMpeg[^] project, which is a .Net wrapper to ffmpeg[^]
Regards,
Lev
|
|
|
|
|
Thanks Lev!
I have tried the following code to embed a flash media player and embed a movie to play, which is bush.wmv. But the page is empty, do you know what is wrong please?
<html>
<body>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550" HEIGHT="400" id="myMovieName"><PARAM NAME=movie VALUE="D:\Bush.wmv"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="/support/flash/ts/documents/myFlashMovie.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400"
NAME="Bush" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>
</body>
</html>
regards,
George
|
|
|
|
|
Well, I think this is not the right forum for this question
But anyway, I think the problem is that you are trying to play Windows Media file (wmv) with Adobe's flash player.
I think you should first convert the wmv to flv.
Regards,
Lev
|
|
|
|
|
Thanks Lev, I will try netffmpeg.
regards,
George
|
|
|
|
|
Hi Lev,
Sorry for interrupting again. I have tried FFDDL, the document is very limited. My purpose is just to convert to Flash format, so I think maybe Adobe could have some SDK to do that? Do you have any ideas?
regards,
George
|
|
|
|
|
Nope, sorry, I haven't done any conversions to flash myself, I just gave you a hint
Regards,
Lev
|
|
|
|
|
Thanks all the same, Lev!
regards,
George
|
|
|
|
|
You're welcome
Regards,
Lev
|
|
|
|
|
How can i build a program that hv two classes (child class and parant class) child class is inheriting from parant class.
Now child class has two methods
1.which returns the name of parant class
2.which returns the object of parant class
|
|
|
|
|
Hi
you could use reflection. This would be in the child class.
<br />
public string GetParentClassName() {<br />
return this.GetType().BaseType.Name;<br />
}<br />
Hmm, the child itself is an object of the parent class. Don't know exactly what you mean with this.
Regards
Sebastian
|
|
|
|
|
I am not sure what do you mean by saying the Name and Object of parent class,
but you can get the Type of the base class like this:
public class Dad {
}
public class Kid : Dad {
public Type GetParentType() {
return this.GetType().BaseType;
}
}
Regards,
Lev
|
|
|
|