Branch: Tag:

2012-02-19

2012-02-19 00:05:27 by Arne Goedeke <el@laramies.com>

pike_memory: new helper cmemset()

178:   void init_pike_memory (void);   void exit_pike_memory (void);    + /* +  * Fill dst with n blocks of size s from src +  */ + static INLINE void cmemset(char * dst, char * src, size_t s, +  size_t n) { +  if (n) { +  memcpy(dst, src, s); +  +  for (--n,n *= s; n >= s; n -= s,s <<= 1) +  memcpy(dst + s, dst, s); +  +  if (n) memcpy(dst + s, dst, n); +  } + } +    #undef BLOCK_ALLOC      #ifdef HANDLES_UNALIGNED_MEMORY_ACCESS