diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-12-03 22:13:51 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-12-03 22:13:51 +0100 |
commit | 382ba1a1630cb1647c8e5ed3feb37364a8f3329f (patch) | |
tree | e430a07890c42f48159a3be3b56b3cc94b93f900 /fastwriter.c | |
parent | 5ae22aeedb43629fed30f64d025b9df3cf25cff8 (diff) | |
parent | 83ebc0af67cf2d4cd5a45fa253dac88f1cb3b1e4 (diff) | |
download | fastwriter-382ba1a1630cb1647c8e5ed3feb37364a8f3329f.tar.gz fastwriter-382ba1a1630cb1647c8e5ed3feb37364a8f3329f.tar.bz2 fastwriter-382ba1a1630cb1647c8e5ed3feb37364a8f3329f.tar.xz fastwriter-382ba1a1630cb1647c8e5ed3feb37364a8f3329f.zip |
Merge custom memcpy
Diffstat (limited to 'fastwriter.c')
-rw-r--r-- | fastwriter.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fastwriter.c b/fastwriter.c index e812681..08722fa 100644 --- a/fastwriter.c +++ b/fastwriter.c @@ -15,11 +15,17 @@ #include <fcntl.h> - #include "private.h" #include "default.h" #include "sysinfo.h" +#ifdef USE_CUSTOM_MEMCPY +# include "memcpy.h" +#else /* USE_CUSTOM_MEMCPY */ +# define fast_memcpy memcpy +#endif /* USE_CUSTOM_MEMCPY */ + + fastwriter_t *fastwriter_init(const char *fs, fastwriter_flags_t flags) { fastwriter_t *ctx; @@ -275,11 +281,11 @@ int fastwriter_push(fastwriter_t *ctx, size_t size, const void *data) { if (part1 < size) { // tail < pos (we have checked for free space) end = size - part1; - memcpy(ctx->buffer + ctx->pos, data, part1); - memcpy(ctx->buffer, data + part1, end); + fast_memcpy(ctx->buffer + ctx->pos, data, part1); + fast_memcpy(ctx->buffer, data + part1, end); ctx->pos = end; } else { - memcpy(ctx->buffer + ctx->pos, data, size); + fast_memcpy(ctx->buffer + ctx->pos, data, size); ctx->pos += size; if (ctx->pos == ctx->size) ctx->pos = 0; |