Optimizing C and C++ Code Embedded software often runs on processors with limited computation power, thus optimizing the code becomes a necessity. In this article we will explore the following optimization techniques for C and C++ code developed for Real-time and Embedded Systems. - Adjust structure sizes to power of two
- Place case labels in narrow range
- Place frequent case labels first
- Break big switch statements into nested switches
- Minimize local variables
- Declare local variables in the inner most scope
- Reduce the number of parameters
- Use references for parameter passing and return value for types bigger than 4 bytes
- Don't define a return value if not used
- Consider locality of reference for code and data
- Prefer int over char and short
- Define lightweight constructors
- Prefer initialization over assignment
- Use constructor initialization lists
- Do not declare "just in case" virtual functions
- In-line 1 to 3 line functions
|
|
Read more...
|
|
Code Optimization Using the GNU C Compiler This article describes some of the code optimization techniques used by the GNU C Compiler, in order to give the reader a feel of what code optimization is and how it can increase the efficiency of the generated object code. Contents - Introduction
- Assembly Language Code for a C Program
- Constant Folding
- Common Subexpression Elimination
- Dead Code Elimination
- Strength Reduction using Induction Variable
- Conclusion
- Acknowledgments
- References
|
|
Read more...
|
|
C optimisation tutorial This document has evolved over time and contains a number of the best ways to hand-optimise your C-code. Compilers are good, but they can't do everything, and here I hope to help you squeeze the best performance out of your code. This is not intended for beginners, but for more experienced programmers.
|
|
Read more...
|
|
Origins of UNIX In 1969, Ken Thompson from AT&T’s Bell Telephone Labs wrote the first version of the UNIX operating system, on a DEC PDP-7. Disillusioned with the inefficiency of the Multics (Multiplexed Information and Computing Service) project, Thompson decided to create a programmer-friendly operating system that limited the functions contained within the kernel and allowed greater flexibility in the design and implementation of applications. The PDP-7 was a modest system on which to build a new operating system. it had only an assembler and a loader,and it would allow only a single user login at any one time. It didn't even have a hard disk, the developers were forced to partition physical memory into an operating system segment and a RAM disk segment.
Thus, the first UNIX file system was emulated entirely in RAM!
|
|
Read more...
|
|
Security Considerations with Diameter This memo does not describe a stand-alone protocol, but a particular application for the Diameter protocol [RFC3588]. Consequently, all the security considerations applicable to Diameter automatically apply to this memo. In particular, Section 13 of RFC 3588 applies to this memo.
This Diameter SIP application allows a Diameter client to use the properties of HTTP Digest authentication [RFC2617] by evaluating or sending to the Diameter server the credentials supplied by a user. The discussion of HTTP Digest authentication in Section 4 of RFC 2617 [RFC2617] is also applicable to this memo.
|
|
Read more...
|
|
Migration from RADIUS to DIAMETER RADIUS offers support for HTTP Digest authentication in the RADIUS Extension for Digest Authentication [RFC4590]. A number of AVPs (the Digest-* AVPs) of this Diameter SIP application are imported from the RADIUS attributes namespace, thus making the migration from RADIUS to Diameter smooth.
Note that the RADIUS Extension for Digest Authentication [RFC4590] provides a more limited scope than this Diameter SIP application. Specifically, the RADIUS extension for Digest Authentication merely provides support for HTTP Digest authentication, whereas the Diameter SIP application provides support for user location, profile downloading and update, etc.
|
|
Read more...
|
|
Diameter SIP Application AVPs This section defines new AVPs used in this Diameter SIP application. Applications compliant with this specification MUST implement these AVPs.
Table 2 lists the new AVPs defined in this Diameter SIP application. The following abbreviations are used in the Data-Type column:
o DURI: DiameterURI o E: Enumerated o G: Grouped o OS: OctetString o UTF8S: UTF8String o U32: Unsigned32
|
|
Read more...
|
|
Diameter SIP Application Command Codes All the Diameter implementations conforming to this specification MUST implement and support the list of Diameter commands listed in Table 1.
+-------------------------------------+-------+------+--------------+ | Command Name | Abbr. | Code | Reference | +-------------------------------------+-------+------+--------------+ | User-Authorization-Request | UAR | 283 | Section 8.1 | | User-Authorization-Answer | UAA | 283 | Section 8.2 | | Server-Assignment-Request | SAR | 284 | Section 8.3 | | Server-Assignment-Answer | SAA | 284 | Section 8.4 | | Location-Info-Request | LIR | 285 | Section 8.5 | | Location-Info-Answer | LIA | 285 | Section 8.6 | | Multimedia-Auth-Request | MAR | 286 | Section 8.7 | | Multimedia-Auth-Answer | MAA | 286 | Section 8.8 | | Registration-Termination-Request | RTR | 287 | Section 8.9 | | Registration-Termination-Answer | RTA | 287 | Section 8.10 | | Push-Profile-Request | PPR | 288 | Section 8.11 | | Push-Profile-Answer | PPA | 288 | Section 8.12 | +-------------------------------------+-------+------+--------------+
Table 1: Defined command codes
|
|
Read more...
|
|
|
|
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>
|
| Results 53 - 65 of 234 |