Changeset 3467821 in mainline for uspace/app/mkexfat/mkexfat.c


Ignore:
Timestamp:
2012-02-24T22:59:51Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b200230
Parents:
552efe3
Message:

mkexfat: performance improvement, reset the buffer's content only if necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkexfat/mkexfat.c

    r552efe3 r3467821  
    4646#include <sys/types.h>
    4747#include <sys/typefmt.h>
     48#include <bool.h>
    4849#include "exfat.h"
    4950#include "upcase.h"
     
    436437        unsigned long allocated_cls;
    437438        int rc = EOK;
     439        bool need_reset = true;
    438440
    439441        /* Bitmap size in sectors */
     
    447449
    448450        for (sec = 0; sec < bss; ++sec) {
    449                 memset(bitmap, 0, cfg->sector_size);
     451                if (need_reset) {
     452                        need_reset = false;
     453                        memset(bitmap, 0, cfg->sector_size);
     454                }
    450455                if (allocated_cls > 0) {
    451456                        for (i = 0; i < allocated_cls; ++i) {
     
    459464
    460465                        allocated_cls -= i;
     466                        need_reset = true;
    461467                }
    462468
Note: See TracChangeset for help on using the changeset viewer.