nsCRT::memcpy(diskEntry->mKeyStart, entry->Key()->get(),keySize);
memcpy(diskEntry->mKeyStart, entry->Key()->get(),keySize);
CreateDiskCacheEntry(nsDiskCacheBinding *  binding){    nsCacheEntry * entry = binding->mCacheEntry;    if (!entry)  return nsnull;        PRUint32  keySize  = entry->Key()->Length() + 1;    PRUint32  metaSize = entry->MetaDataSize();    PRUint32  size     = sizeof(nsDiskCacheEntry) + keySize + metaSize;        // pad size so we can write to block files without overrunning buffer    PRInt32 pad = size;    if      (pad <  1024) pad =  1024;    else if (pad <  4096) pad =  4096;    else if (pad < 16384) pad = 16384;    // XXX be more precise        nsDiskCacheEntry * diskEntry = (nsDiskCacheEntry *)new char[pad];    if (!diskEntry)  return nsnull;        diskEntry->mHeaderVersion   = nsDiskCache::kCurrentVersion;    diskEntry->mMetaLocation    = binding->mRecord.MetaLocation();    diskEntry->mFetchCount      = entry->FetchCount();    diskEntry->mLastFetched     = entry->LastFetched();    diskEntry->mLastModified    = entry->LastModified();    diskEntry->mExpirationTime  = entry->ExpirationTime();    diskEntry->mDataSize        = entry->DataSize();    diskEntry->mKeySize         = keySize;    diskEntry->mMetaDataSize    = metaSize;        nsCRT::memcpy(diskEntry->mKeyStart, entry->Key()->get(),keySize);        nsresult rv = entry->FlattenMetaData(&diskEntry->mKeyStart[keySize], metaSize);    if (NS_FAILED(rv)) {        delete [] (char *)diskEntry;        return nsnull;    }            pad -= diskEntry->Size();    NS_ASSERTION(pad >= 0, "under allocated buffer for diskEntry.");    if (pad > 0)        nsCRT::zero(&diskEntry->mKeyStart[keySize+metaSize], pad);        return  diskEntry;}