else return nsnull;
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;    if      (size <=  1024) pad = (((size-1)/ 256) + 1) *  256;    else if (size <=  4096) pad = (((size-1)/1024) + 1) * 1024;    else if (size <= 16384) pad = (((size-1)/4096) + 1) * 4096;        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;        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)        memset(&diskEntry->mKeyStart[keySize+metaSize], 0, pad);        return  diskEntry;}