Linux, programming, computers and life

July 31, 2008

memset64, anyone?

Filed under: programming, c++

I wonder why memset is the only mean we have in libc in order to fill memory. We are limited to filling the memory with certain char. What if i want to use longer pattern? Is there anything like memset64? Generally, i’d like to fill the buffer with pattern which is 4 or 8 bytes long. I’m pretty sure, that’s the way memset is implemented anyway, for performance.
Maybe i’m missing something, but i was unable to find anything like this in the libc.

3 Comments »

The URI to TrackBack this entry is: http://linux4all.blogsome.com/2008/07/31/memset64-anyone/trackback/

  1. That’s a good question. I couldn’t find anything similar either, but I did find functions I never heard of before:
    man 3 strfry
    man 3 strfrob
    man 3 memmem (I guess I should have known this one existed)

    Comment by gnobal — August 26, 2008 @ 10:54

  2. You have this tagged C++, so I would suggest std::fill().

    Comment by Anonymous — September 29, 2008 @ 18:21

  3. Is there anything you can say about std::fill efficiency?

    Comment by linux4all — October 2, 2008 @ 07:18

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Gary Rogers