memset64, anyone?
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.


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
You have this tagged C++, so I would suggest std::fill().
Comment by Anonymous — September 29, 2008 @ 18:21
Is there anything you can say about std::fill efficiency?
Comment by linux4all — October 2, 2008 @ 07:18