Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / November 2005

Tip: Looking for answers? Try searching our database.

MSIL size limit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Etienne Fortin - 22 Nov 2005 15:28 GMT
Looking at the output of ildasm, I was wondering if there's a size limit on
msil for any given method. The IL_xxxx index is an hexa number on 16-bits.
Does it mean that for any given method, there's a 64 kb size limit?

I know I shoudn't create methods so big, but let's say I want a 256 kb
method. Would it compile?
Gabriele G. Ponti - 22 Nov 2005 18:23 GMT
Those labels are added by ILDASM, it's not a restriction of the MSIL. If you
consider the branch instruction the offset is 32 bit, so you can assume that
there's no 16 bit restriction.

   Gabriele
Richard Grimes - 26 Nov 2005 21:46 GMT
> Looking at the output of ildasm, I was wondering if there's a size
> limit on msil for any given method. The IL_xxxx index is an hexa
> number on 16-bits. Does it mean that for any given method, there's a
> 64 kb size limit?

The IL for every method has a header, it is either 'tiny' or 'fat'
format. The tiny format header uses 6 bits to indicate the size of the
method (64 bytes). The fat format uses 4 bytes to indicate the size of
the method (4Gb).

> I know I shoudn't create methods so big, but let's say I want a 256 kb
> method. Would it compile?

Yes, but it would be a bit silly because you can guarantee that much of
the code won't be called, and if you factorize the code into methods it
would reduce considerably the amount of code that would be JIT compiled.
Of course, I know that you are not thinking of writing a 256 Kb method
<g>

Richard
Signature

http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.