VirtualBox

Changeset 22007 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Aug 5, 2009 6:42:00 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50742
Message:

iprt/zip.cpp: notes from zero page optimizations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/zip.cpp

    r21848 r22007  
    6767#include "internal/iprt.h"
    6868
     69/*#include <iprt/asm.h>*/
    6970#include <iprt/alloc.h>
    7071#include <iprt/assert.h>
     
    17001701        {
    17011702#ifdef RTZIP_USE_LZF
     1703# if 0
     1704            static const uint8_t s_abZero4K[] =
     1705            {
     1706                0x01, 0x00, 0x00, 0xe0, 0xff, 0x00, 0xe0, 0xff,
     1707                0x00, 0xe0, 0xff, 0x00, 0xe0, 0xff, 0x00, 0xe0,
     1708                0xff, 0x00, 0xe0, 0xff, 0x00, 0xe0, 0xff, 0x00,
     1709                0xe0, 0xff, 0x00, 0xe0, 0xff, 0x00, 0xe0, 0xff,
     1710                0x00, 0xe0, 0xff, 0x00, 0xe0, 0xff, 0x00, 0xe0,
     1711                0xff, 0x00, 0xe0, 0xff, 0x00, 0xe0, 0xff, 0x00,
     1712                0xe0, 0x7d, 0x00
     1713            };
     1714            if (    cbSrc == _4K
     1715                &&  !((uintptr_t)pvSrc & 15)
     1716                &&  ASMMemIsZeroPage(pvSrc))
     1717            {
     1718                if (RT_UNLIKELY(cbDst < sizeof(s_abZero4K)))
     1719                    return VERR_BUFFER_OVERFLOW;
     1720                memcpy(pvDst, s_abZero4K, sizeof(s_abZero4K));
     1721                *pcbDstActual = sizeof(s_abZero4K);
     1722                break;
     1723            }
     1724# endif
     1725
    17021726            unsigned cbDstActual = lzf_compress(pvSrc, cbSrc, pvDst, cbDst);
    17031727            if (RT_UNLIKELY(cbDstActual < 1))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette