The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 04:51 AM
awk and fuction (recursion) !! Urgent !! varungupta UNIX for Advanced & Expert Users 12 04-16-2008 05:12 PM
questions in memset arunkumar_mca UNIX for Dummies Questions & Answers 7 08-09-2007 12:08 PM
Get Oracle fuction return value in a variable rahulrathod UNIX for Dummies Questions & Answers 3 04-14-2005 12:50 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-29-2006
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

Join Date: Oct 2005
Location: Chennai
Posts: 365
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?
  #2 (permalink)  
Old 01-29-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
memset is usually the most efficient way to initialize an data area. It should not contribute very much to the load.
  #3 (permalink)  
Old 01-30-2006
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

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

Thanks Perderabo.
  #4 (permalink)  
Old 01-31-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0