Solved

Inline function in VB.NET

Posted on 2003-11-12
4
1,182 Views
Last Modified: 2010-05-18
I want to know if I can write an inline function in VB.NET.
0
Comment
Question by:fatalk1ll3r
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Expert Comment

by:_TAD_
ID: 9731790


Actually it is possible.

The .Net Architexture automatically inlines functions if they are smaller than a certain byte size.
0
 
LVL 22

Expert Comment

by:_TAD_
ID: 9731846

From MSDN:

"The JIT compiler automatically inlines any non-virtual method calls that consist of simple control flow and consists of less than 32 bytes of IL instructions."



In order to find out how many bytes of IL instructions a function is, use the ILDASM.exe program (it comes with .Net Framework).  Point it at your compiled project and be sure to set the properties to show the size of the function.
0
 
LVL 22

Accepted Solution

by:
_TAD_ earned 50 total points
ID: 9731891


Here is a web page that confirms my statement:
http://www.codeproject.com/dotnet/strings.asp?print=true

search page for "inlines"
0

Featured Post

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question