/alps/fastwriter

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/fastwriter

« back to all changes in this revision

Viewing changes to fastwriter.c

  • Committer: Suren A. Chilingaryan
  • Date: 2012-11-25 07:04:11 UTC
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: csa@dside.dyndns.org-20121125070411-ls1zwe3sunltdlb0
Use memcpy implementation by Daniel Vik

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "private.h"
20
20
#include "default.h"
21
21
#include "sysinfo.h"
 
22
#include "memcpy.h"
22
23
 
23
24
fastwriter_t *fastwriter_init(const char *fs, fastwriter_flags_t flags) {
24
25
    fastwriter_t *ctx;
275
276
    if (part1 < size) {
276
277
            // tail < pos (we have checked for free space)
277
278
        end = size - part1;
278
 
        memcpy(ctx->buffer + ctx->pos, data, part1);
279
 
        memcpy(ctx->buffer, data + part1, end);
 
279
        fast_memcpy(ctx->buffer + ctx->pos, data, part1);
 
280
        fast_memcpy(ctx->buffer, data + part1, end);
280
281
        ctx->pos = end;
281
282
    } else {
282
 
        memcpy(ctx->buffer + ctx->pos, data, size);
 
283
        fast_memcpy(ctx->buffer + ctx->pos, data, size);
283
284
        ctx->pos += size;
284
285
        
285
286
        if (ctx->pos == ctx->size) ctx->pos = 0;