UrbanPro

Learn Programming Languages from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What are the restriction in making a inline function?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

Trainer

Inline function is the optimization technique used by the compilers. One can simply prepend inline keyword to function prototype to make a function inline. Inline function instruct compiler to insert complete body of the function wherever that function got used in code. Advantages :- 1) It does...
read more
Inline function is the optimization technique used by the compilers. One can simply prepend inline keyword to function prototype to make a function inline. Inline function instruct compiler to insert complete body of the function wherever that function got used in code. Advantages :- 1) It does not require function calling overhead. 2) It also save overhead of variables push/pop on the stack, while function calling. 3) It also save overhead of return call from a function. 4) It increases locality of reference by utilizing instruction cache. 5) After in-lining compiler can also apply intraprocedural optmization if specified. This is the most important one, in this way compiler can now focus on dead code elimination, can give more stress on branch prediction, induction variable elimination etc.. Disadvantages :- 1) May increase function size so that it may not fit on the cache, causing lots of cahce miss. 2) After in-lining function if variables number which are going to use register increases than they may create overhead on register variable resource utilization. 3) It may cause compilation overhead as if some body changes code inside inline function than all calling location will also be compiled. 4) If used in header file, it will make your header file size large and may also make it unreadable. 5) If somebody used too many inline function resultant in a larger code size than it may cause thrashing in memory. More and more number of page fault bringing down your program performance. 6) Its not useful for embeded system where large binary size is not preferred at all due to memory size constraints. read less
Comments

Coaching

We put inline keyword in front of a function which requests a compiler to make that function as inline function. Following are the situations where inline functions may not work properly: 1.If we have two or three statements then it works otherwise compiler will ignore inline keyword and will...
read more
We put inline keyword in front of a function which requests a compiler to make that function as inline function. Following are the situations where inline functions may not work properly: 1.If we have two or three statements then it works otherwise compiler will ignore inline keyword and will treat as a normal function. 2.Functions returning values, having a loop, a switch or a go to statement. 3.If the function contains static variables. 4.If inline functions are recursive. read less
Comments

IT Professional Trainer with 15 years of experience in IT Industry

Can you explain what do you want to know exactly?
Comments

Software Professional Trainer with 26+ years of Experience in Software Design and Development

Inline function will very useful if your line of code is very less, it will improve the peformance. If the line of code inside the function is more, then inline will not improve the performance. Before compilation, the inline function call will be replaced with actual of inside the inline functio...
Comments

Artificial intelligence Trainer

Inline function is used when u have just 1-2 or small line of code to be used many times so through inline function we write code inside inline function and call that inline function wherever we require that code for eg if have want c=a+b to be used in more than one place i will create an inline function...
read more
Inline function is used when u have just 1-2 or small line of code to be used many times so through inline function we write code inside inline function and call that inline function wherever we require that code for eg if have want c=a+b to be used in more than one place i will create an inline function inlindemo(int a,int b) { c=a+b; } and wherever that addition code needs to be written i will simply call inlindemo so that my processing time is reduced and it speeds up the execution of coding one greatest disadvantage of inline function is that if code has more number of lines there is no use of creating that code inside inline function because writing large lines of code inside inline function has more overhead involved while calling the inline function rather than writing the large code again and again so basically inline function is used only for small line of codes read less
Comments

Tutor

Inline function is the optimization technique used by the compilers. One can simply prepend inline keyword to function prototype to make a function inline. Inline function instruct compiler to insert complete body of the function wherever that function got used in code. Disadvantages :- 1) May increase...
read more
Inline function is the optimization technique used by the compilers. One can simply prepend inline keyword to function prototype to make a function inline. Inline function instruct compiler to insert complete body of the function wherever that function got used in code. Disadvantages :- 1) May increase function size so that it may not fit on the cache, causing lots of cahce miss. 2) After in-lining function if variables number which are going to use register increases than they may create overhead on register variable resource utilization. 3) It may cause compilation overhead as if some body changes code inside inline function than all calling location will also be compiled. 4) If used in header file, it will make your header file size large and may also make it unreadable. 5) If somebody used too many inline function resultant in a larger code size than it may cause thrashing in memory. More and more number of page fault bringing down your program performance. 6) Its not useful for embeded system where large binary size is not preferred at all due to memory size constraints read less
Comments

Tutor taking Computer subjects Classes

Inline function must be defined above from the point of its call.
Comments

Making a function inline is just a request to compiler to insert complete body of function at all places of function calls. The request may or may not be entertained by the compiler. Compiler makes these decision on the basis of number of function calls and the length of the function.
Comments

MCA | GNIIT and Sangeet bhusan (Tabla)

The basic idea is to make short and simple functions to be in-lined for faster execution. Also the functions defined inside the class are by default inline but still depends on compiler if it has loops, long code, lots of changes in flow of control, return statements then the compiler will not treat...
read more
The basic idea is to make short and simple functions to be in-lined for faster execution. Also the functions defined inside the class are by default inline but still depends on compiler if it has loops, long code, lots of changes in flow of control, return statements then the compiler will not treat it as a inline function. read less
Comments

1) May increase function size so that it may not fit on the cache, causing lots of cahce miss. 2) After in-lining function if variables number which are going to use register increases than they may create overhead on register variable resource utilization. 3) It may cause compilation overhead as if...
read more
1) May increase function size so that it may not fit on the cache, causing lots of cahce miss. 2) After in-lining function if variables number which are going to use register increases than they may create overhead on register variable resource utilization. 3) It may cause compilation overhead as if some body changes code inside inline function than all calling location will also be compiled. 4) If used in header file, it will make your header file size large and may also make it unreadable. 5) If somebody used too many inline function resultant in a larger code size than it may cause thrashing in memory. More and more number of page fault bringing down your program performance. 6) Its not useful for embeded system where large binary size is not preferred at all due to memory size constraints. read less
Comments

View 9 more Answers

Related Questions

Which Python should I learn, Python 2.7 or 3.x?
Better to learn latest versions always. You cannot find much differences. If you learn one version remaining versions you can understand easily.
Swapna
0 0
7
Which language is best, C, C++, Python or Java?
If you want to learn any languages C#, Java, ect. then must to learn C, C++ language as these are base or language to be strong in language skills. C++ is improved version of C language. C#, Java, J# and etc. which are improved version of C++.
Sribaghya
0 0
6
How do I learn C programming by videos or books?
BOOKS AND PRACTICE by far remain the best way for learning any language ....
Fgrefg
0 0
7
How to enroll for the course?
register here then post your requirements,do provide your ph no by which trainers can contact you or you can individually search for trainers nearest to your location and contact them.
Alpana

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

What is the difference between PHP and PYTHON
Let's start with PHP: - Ideal for standard web development- Easy integration with MySQL- $_GET and $_POST built into the language- C-Esque syntax Primarily used on an Apache server (Routinely, you...

Machine Learning With Python
1. Course description: Machine Learning with Python has been designed for the provision of having strong hold in creating Machine learning algorithms with the base of Python. This has been preferred as...
J

Set 0 To Kth Bit In A Variable
The following code snippet Set 0 to Kth Bit in an variable #include int UnsetBitValue(int n, int k);int main(){ printf("%d\n\n",UnsetBitValue(255,6)); return 0;}// Set kth bit to zeroint UnsetBitValue(int...


C++ Program-Single Dimension Array
/* WAP to print sum and largest value in a single dimension array*/ //Header files #include<iostream.h>#include<conio.h> //Main function void main(){ //Array declaration int num,i,sum,large;...
S

Recommended Articles

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Looking for Programming Languages Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Programming Languages Classes?

The best tutors for Programming Languages Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Programming Languages with the Best Tutors

The best Tutors for Programming Languages Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more