![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| fuction return in perl | jisha | Shell Programming and Scripting | 4 | 05-15-2008 01:51 AM |
| awk and fuction (recursion) !! Urgent !! | varungupta | UNIX for Advanced & Expert Users | 12 | 04-16-2008 02:12 PM |
| questions in memset | arunkumar_mca | UNIX for Dummies Questions & Answers | 7 | 08-09-2007 09:08 AM |
| Get Oracle fuction return value in a variable | rahulrathod | UNIX for Dummies Questions & Answers | 3 | 04-14-2005 09:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Dear all,
In my code,i am planning to use memset function to re-initialise an array before populating it everytime. Will using memset function be an overload to the program? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
memset is usually the most efficient way to initialize an data area. It should not contribute very much to the load.
|
|
#3
|
|||
|
|||
|
Thanks Perderabo.
|
|
#4
|
|||
|
|||
|
low-level standard C library functions like memcpy and memset are almost always implemented as the most efficient possible manner fro the hardware. Some environments use libc when optimization is turned off for these modules. Check you compiler's man page. Turning optimation on forces the compiler/linker to load in the most efficient version in those environments.
As an example of this, HPUX has a millicode version of memset - a very fast implementation. It also has an entry point for a non-millicode memset in libc, _memset20 |
|||
| Google The UNIX and Linux Forums |