pike.git / src / pike_memory.h

version» Context lines:

pike.git/src/pike_memory.h:171:   PMOD_EXPORT void debug_xfree(void *mem);   PMOD_EXPORT void *debug_xrealloc(void *m, size_t s) MALLOC_FUNCTION;   PMOD_EXPORT void *debug_xcalloc(size_t n, size_t s) MALLOC_FUNCTION;      PMOD_EXPORT void *mexec_alloc(size_t sz) MALLOC_FUNCTION;   PMOD_EXPORT void *mexec_realloc(void *ptr, size_t sz) MALLOC_FUNCTION;   PMOD_EXPORT void mexec_free(void *ptr);   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   #define DO_IF_ELSE_UNALIGNED_MEMORY_ACCESS(IF, ELSE) IF   #else /* !HANDLES_UNALIGNED_MEMORY_ACCESS */   #define DO_IF_ELSE_UNALIGNED_MEMORY_ACCESS(IF, ELSE) ELSE   #endif /* HANDLES_UNALIGNED_MEMORY_ACCESS */      /* Determine if we should use our own heap manager for executable    * memory. */   #if defined(MEXEC_USES_MMAP) || defined (_WIN32)   #define USE_MY_MEXEC_ALLOC   #endif      #endif