The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-29-2006
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 364
Unhappy about memset fuction

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?
Reply With Quote
Forum Sponsor
  #2  
Old 01-29-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
memset is usually the most efficient way to initialize an data area. It should not contribute very much to the load.
Reply With Quote
  #3  
Old 01-29-2006
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 364
Smile Thanks

Thanks Perderabo.
Reply With Quote
  #4  
Old 01-31-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,274
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0