• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IAlloc_Free函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IAlloc_Free函数的典型用法代码示例。如果您正苦于以下问题:C++ IAlloc_Free函数的具体用法?C++ IAlloc_Free怎么用?C++ IAlloc_Free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IAlloc_Free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SzFolder_Free

void SzFolder_Free(CSzFolder *p, ISzAlloc *alloc)
{
   uint32_t i;
   if (p->Coders)
      for (i = 0; i < p->NumCoders; i++)
         SzCoderInfo_Free(&p->Coders[i], alloc);
   IAlloc_Free(alloc, p->Coders);
   IAlloc_Free(alloc, p->BindPairs);
   IAlloc_Free(alloc, p->PackStreams);
   IAlloc_Free(alloc, p->UnpackSizes);
   SzFolder_Init(p);
}
开发者ID:Brunnis,项目名称:RetroArch,代码行数:12,代码来源:7zIn.c


示例2: SzArEx_Free

void SzArEx_Free(CSzArEx *p, ISzAlloc *alloc)
{
   IAlloc_Free(alloc, p->FolderStartPackStreamIndex);
   IAlloc_Free(alloc, p->PackStreamStartPositions);
   IAlloc_Free(alloc, p->FolderStartFileIndex);
   IAlloc_Free(alloc, p->FileIndexToFolderIndexMap);

   IAlloc_Free(alloc, p->FileNameOffsets);
   Buf_Free(&p->FileNames, alloc);

   SzAr_Free(&p->db, alloc);
   SzArEx_Init(p);
}
开发者ID:Brunnis,项目名称:RetroArch,代码行数:13,代码来源:7zIn.c


示例3: SzAr_Free

void SzAr_Free(CSzAr *p, ISzAlloc *alloc)
{
   uint32_t i;
   if (p->Folders)
      for (i = 0; i < p->NumFolders; i++)
         SzFolder_Free(&p->Folders[i], alloc);

   IAlloc_Free(alloc, p->PackSizes);
   IAlloc_Free(alloc, p->PackCRCsDefined);
   IAlloc_Free(alloc, p->PackCRCs);
   IAlloc_Free(alloc, p->Folders);
   IAlloc_Free(alloc, p->Files);
   SzAr_Init(p);
}
开发者ID:Brunnis,项目名称:RetroArch,代码行数:14,代码来源:7zIn.c


示例4: Decompress

		/*!
		 * \brief
		 * Decompresses a single file entry from a 7zip archive, into memory.
		 * 
		 * \param archive_stream
		 * The stream to read the compressed data from.
		 * 
		 * \param archive_desc
		 * The archives description struct.
		 * 
		 * \param look_stream
		 * The stream associated with the archive stream.
		 * 
		 * \param file_index
		 * Index of the file to extract.
		 * 
		 * \param uncompressed_data
		 * The pointer reference to set when allocating memory for the uncompressed data.
		 * 
		 * \param uncompressed_data_size
		 * Reference to set the uncompressed datas size to.
		 * 
		 * \returns
		 * Returns SZ_OK if decompression was successfully, otherwise returns a non-zero value.
		 * 
		 * Decompresses a single file entry from a 7zip archive, into memory.
		 */
		static SRes Decompress(CFileInStream& archive_stream,
			CSzArEx& archive_desc,
			CLookToRead& look_stream,
			uint32 file_index,
			byte*& uncompressed_data,
			size_t& uncompressed_data_size)
		{
			ISzAlloc alloc_imp;
			SRes result = SZ_OK;

			// set functions 7zip will use to allocated and free memory
			alloc_imp.Alloc = AllocFunc;
			alloc_imp.Free = FreeFunc;

			UInt32 block_index = 0xFFFFFFFF;
			size_t offset = 0;
			size_t out_size_processed = 0;

			// decompress the requested file, saving the uncompressed data into memory
			result = SzArEx_Extract(&archive_desc, &look_stream.s, file_index,
				&block_index, &uncompressed_data, &uncompressed_data_size,
				&offset, &out_size_processed,
				&alloc_imp, &alloc_imp);

			if (result != SZ_OK)
			{
				// the decompression failed, so delete the allocated data
				IAlloc_Free(&alloc_imp, uncompressed_data);
				uncompressed_data = NULL;

				uncompressed_data_size = 0;
			}

			return result;
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:62,代码来源:7zip_codec.cpp


示例5: IAlloc_Free

 ~Qt7zPackagePrivate()
 {
     if (m_outBuffer) {
         IAlloc_Free(&m_allocImp, m_outBuffer);
         m_outBuffer = 0;
     }
 }
开发者ID:vmille,项目名称:Qt7z,代码行数:7,代码来源:qt7zpackage.cpp


示例6: _7z_close

static void _7z_close(ar_archive *ar)
{
    ar_archive_7z *_7z = (ar_archive_7z *)ar;
    free(_7z->entry_name);
    SzArEx_Free(&_7z->data, &gSzAlloc);
    IAlloc_Free(&gSzAlloc, _7z->uncomp.buffer);
}
开发者ID:cllpyl,项目名称:sumatrapdf,代码行数:7,代码来源:_7z.c


示例7: IAlloc_Free

	~C7zArchive()
	{
		if (OutBuffer != NULL)
		{
			IAlloc_Free(&g_Alloc, OutBuffer);
		}
		SzArEx_Free(&DB, &g_Alloc);
	}
开发者ID:Jarvizx,项目名称:gz3doom,代码行数:8,代码来源:file_7z.cpp


示例8: CMtThread_Destruct

static void CMtThread_Destruct(CMtThread *p)
{
  CMtThread_CloseEvents(p);

  if (Thread_WasCreated(&p->thread.thread))
  {
    LoopThread_StopAndWait(&p->thread);
    LoopThread_Close(&p->thread);
  }

  if (p->mtCoder->alloc)
    IAlloc_Free(p->mtCoder->alloc, p->outBuf);
  p->outBuf = 0;

  if (p->mtCoder->alloc)
    IAlloc_Free(p->mtCoder->alloc, p->inBuf);
  p->inBuf = 0;
}
开发者ID:08opt,项目名称:gaeproxy,代码行数:18,代码来源:MtCoder.c


示例9: IAlloc_Free

CArchive7Zip::~CArchive7Zip()
{
	if (outBuffer) {
		IAlloc_Free(&allocImp, outBuffer);
	}
	if (isOpen) {
		File_Close(&archiveStream.file);
	}
	SzArEx_Free(&db, &allocImp);
}
开发者ID:BrainDamage,项目名称:spring,代码行数:10,代码来源:Archive7Zip.cpp


示例10: SzReadAndDecodePackedStreams

static SRes SzReadAndDecodePackedStreams(
      ILookInStream *inStream,
      CSzData *sd,
      CBuf *outBuffer,
      uint64_t baseOffset,
      ISzAlloc *allocTemp)
{
   CSzAr p;
   uint64_t *unpackSizes = 0;
   uint8_t *digestsDefined = 0;
   uint32_t *digests = 0;
   SRes res;
   SzAr_Init(&p);
   res = SzReadAndDecodePackedStreams2(inStream, sd, outBuffer, baseOffset,
         &p, &unpackSizes, &digestsDefined, &digests,
         allocTemp);
   SzAr_Free(&p, allocTemp);
   IAlloc_Free(allocTemp, unpackSizes);
   IAlloc_Free(allocTemp, digestsDefined);
   IAlloc_Free(allocTemp, digests);
   return res;
}
开发者ID:Brunnis,项目名称:RetroArch,代码行数:22,代码来源:7zIn.c


示例11: SzReadAndDecodePackedStreams

static SRes SzReadAndDecodePackedStreams(
    ISeekInStream *inStream,
    CSzData *sd,
    ISeqOutStream *outStream,
    UInt64 baseOffset,
    ISzAlloc *allocTemp)
{
  CSzAr p;
  UInt64 *unpackSizes = 0;
  Byte *digestsDefined = 0;
  UInt32 *digests = 0;
  SRes res;
  SzAr_Init(&p);
  res = SzReadAndDecodePackedStreams2(inStream, sd, outStream, baseOffset,
    &p, &unpackSizes, &digestsDefined, &digests,
    allocTemp);
  SzAr_Free(&p, allocTemp);
  IAlloc_Free(allocTemp, unpackSizes);
  IAlloc_Free(allocTemp, digestsDefined);
  IAlloc_Free(allocTemp, digests);
  return res;
}
开发者ID:huairen,项目名称:JArchive,代码行数:22,代码来源:7zIn.c


示例12: SzArEx_DictCache_free

void
SzArEx_DictCache_free(SzArEx_DictCache *dictCache)
{
  if (dictCache->mapFile) {
    // unmap memory
    SzArEx_DictCache_munmap(dictCache);
    // close file handle (it will be set to NULL in init method)
    // FIXME: can we close the FILE* and just hold on to the mmap pointer? I think
    // that will keep the fd open until the mapping is closed.
    fclose(dictCache->mapFile);
  } else if (dictCache->outBuffer != 0) {
    // free memory that was allocated on the heap
    IAlloc_Free(dictCache->allocMain, dictCache->outBuffer);
  }
  SzArEx_DictCache_init(dictCache, dictCache->allocMain);
}
开发者ID:FyhSky,项目名称:AVAnimator,代码行数:16,代码来源:7zIn.c


示例13: sevenzip_stream_free

static void sevenzip_stream_free(void *data)
{
   struct sevenzip_context_t *sevenzip_context = (struct sevenzip_context_t*)data;

   if (!sevenzip_context)
      return;

   if (sevenzip_context->output)
   {
      IAlloc_Free(&sevenzip_context->allocImp, sevenzip_context->output);
      sevenzip_context->output = NULL;
      sevenzip_context->handle->data = NULL;
   }

   SzArEx_Free(&sevenzip_context->db, &sevenzip_context->allocImp);
   File_Close(&sevenzip_context->archiveStream.file);
}
开发者ID:KitoHo,项目名称:RetroArch,代码行数:17,代码来源:archive_file_7z.c


示例14: SzAr_Free

static void SzAr_Free(CSzAr *p, ISzAlloc *alloc)
{
  IAlloc_Free(alloc, p->PackPositions);
  SzBitUi32s_Free(&p->FolderCRCs, alloc);
 
  IAlloc_Free(alloc, p->FoCodersOffsets);
  IAlloc_Free(alloc, p->FoStartPackStreamIndex);
  IAlloc_Free(alloc, p->FoToCoderUnpackSizes);
  IAlloc_Free(alloc, p->FoToMainUnpackSizeIndex);
  IAlloc_Free(alloc, p->CoderUnpackSizes);
  
  IAlloc_Free(alloc, p->CodersData);

  SzAr_Init(p);
}
开发者ID:670232921,项目名称:pfm_archive,代码行数:15,代码来源:7zArcIn.c


示例15: free__7z_file

static void free__7z_file(_7z_file *_7z)
{
	if (_7z != NULL)
	{
		if (_7z->archiveStream.file._7z_osdfile != NULL)
			osd_close(_7z->archiveStream.file._7z_osdfile);
		if (_7z->filename != NULL)
			free((void *)_7z->filename);


		if (_7z->outBuffer) IAlloc_Free(&_7z->allocImp, _7z->outBuffer);
		if (_7z->inited) SzArEx_Free(&_7z->db, &_7z->allocImp);


		free(_7z);
	}
}
开发者ID:AreaScout,项目名称:mame-libretro,代码行数:17,代码来源:un7z.c


示例16: strncpy

CBuf* SZFilePack::openFile(const char* fileName)
{
	char szFileName[MAX_PATH+1] = "";
	strncpy(szFileName, fileName, MAX_PATH);
	NormalFileName(szFileName);
	_strlwr(szFileName);

	FileIndexMap::iterator itFind = mIndexMap.find(szFileName);
	if (itFind == mIndexMap.end())
		return NULL;

	//if you need cache, use these 3 variables.
	//if you use external function, you can make these variable as static.
	UInt32 blockIndex = 0xFFFFFFFF; // it can have any value before first call (if outBuffer = 0)
	Byte *outBuffer = 0; // it must be 0 before first call for each new archive.
	size_t outBufferSize = 0;  // it can have any value before first call (if outBuffer = 0)
	size_t offset = 0;
	size_t outSizeProcessed = 0;
	SRes res;

	size_t index = itFind->second;
	res = SzArEx_Extract(&mDb, &mLookStream.s, index,
		&blockIndex, &outBuffer, &outBufferSize,
		&offset, &outSizeProcessed,
		&mAllocImp, &mAllocTempImp);
	if (res != SZ_OK)
		return NULL;

	closeFile();
	mFileBuffer = new CBuf;
	mFileBuffer->data = new byte[outSizeProcessed];
	memcpy(mFileBuffer->data, outBuffer+offset, outSizeProcessed);
	mFileBuffer->size = outSizeProcessed;

	IAlloc_Free(&mAllocImp, outBuffer);

	return mFileBuffer;
}
开发者ID:ueverything,项目名称:easyserver,代码行数:38,代码来源:7zFilePack.cpp


示例17: SzArEx_Free

void SzArEx_Free(CSzArEx *p, ISzAlloc *alloc)
{
  IAlloc_Free(alloc, p->UnpackPositions);
  IAlloc_Free(alloc, p->IsDirs);

  IAlloc_Free(alloc, p->FolderToFile);
  IAlloc_Free(alloc, p->FileToFolder);

  IAlloc_Free(alloc, p->FileNameOffsets);
  IAlloc_Free(alloc, p->FileNames);

  SzBitUi32s_Free(&p->CRCs, alloc);
  SzBitUi32s_Free(&p->Attribs, alloc);
  // SzBitUi32s_Free(&p->Parents, alloc);
  SzBitUi64s_Free(&p->MTime, alloc);
  SzBitUi64s_Free(&p->CTime, alloc);
  
  SzAr_Free(&p->db, alloc);
  SzArEx_Init(p);
}
开发者ID:670232921,项目名称:pfm_archive,代码行数:20,代码来源:7zArcIn.c


示例18: SzArEx_Free

void SzArEx_Free(CSzArEx *p, ISzAlloc *alloc)
{
  // IAlloc_Free(alloc, p->FolderStartPackStreamIndex);
  // IAlloc_Free(alloc, p->PackStreamStartPositions);
  IAlloc_Free(alloc, p->FolderStartFileIndex);
  IAlloc_Free(alloc, p->FileIndexToFolderIndexMap);

  IAlloc_Free(alloc, p->FileNameOffsets);
  IAlloc_Free(alloc, p->FileNames);

  SzBitUi64s_Free(&p->CTime, alloc);
  SzBitUi64s_Free(&p->MTime, alloc);
  SzBitUi32s_Free(&p->CRCs, alloc);
  // SzBitUi32s_Free(&p->Parents, alloc);
  SzBitUi32s_Free(&p->Attribs, alloc);
  IAlloc_Free(alloc, p->IsDirs);
  // IAlloc_Free(alloc, p->IsEmptyFiles);
  IAlloc_Free(alloc, p->UnpackPositions);
  // IAlloc_Free(alloc, p->Files);

  SzAr_Free(&p->db, alloc);
  SzArEx_Init(p);
}
开发者ID:ChokshiUtsav,项目名称:kolibriosSVN,代码行数:23,代码来源:7zArcIn.c


示例19: SzReadHeader

static SRes SzReadHeader(
      CSzArEx *p,
      CSzData *sd,
      ISzAlloc *allocMain,
      ISzAlloc *allocTemp)
{
   uint64_t *unpackSizes = 0;
   uint8_t *digestsDefined = 0;
   uint32_t *digests = 0;
   uint8_t *emptyStreamVector = 0;
   uint8_t *emptyFileVector = 0;
   uint8_t *lwtVector = 0;
   SRes res = SzReadHeader2(p, sd,
         &unpackSizes, &digestsDefined, &digests,
         &emptyStreamVector, &emptyFileVector, &lwtVector,
         allocMain, allocTemp);
   IAlloc_Free(allocTemp, unpackSizes);
   IAlloc_Free(allocTemp, digestsDefined);
   IAlloc_Free(allocTemp, digests);
   IAlloc_Free(allocTemp, emptyStreamVector);
   IAlloc_Free(allocTemp, emptyFileVector);
   IAlloc_Free(allocTemp, lwtVector);
   return res;
}
开发者ID:Brunnis,项目名称:RetroArch,代码行数:24,代码来源:7zIn.c


示例20: main


//.........这里部分代码省略.........
            stdout);
        res = PrintString(temp);
        if (res != SZ_OK)
          break;
        
        if (isDir)
          printf("/");
        else
        {
          res = SzArEx_Extract(&db, &lookStream.s, i,
              &blockIndex, &outBuffer, &outBufferSize,
              &offset, &outSizeProcessed,
              &allocImp, &allocTempImp);
          if (res != SZ_OK)
            break;
        }
        
        if (!testCommand)
        {
          CSzFile outFile;
          size_t processedSize;
          size_t j;
          UInt16 *name = (UInt16 *)temp;
          const UInt16 *destPath = (const UInt16 *)name;
 
          for (j = 0; name[j] != 0; j++)
            if (name[j] == '/')
            {
              if (fullPaths)
              {
                name[j] = 0;
                MyCreateDir(name);
                name[j] = CHAR_PATH_SEPARATOR;
              }
              else
                destPath = name + j + 1;
            }
    
          if (isDir)
          {
            MyCreateDir(destPath);
            printf("\n");
            continue;
          }
          else if (OutFile_OpenUtf16(&outFile, destPath))
          {
            PrintError("can not open output file");
            res = SZ_ERROR_FAIL;
            break;
          }

          processedSize = outSizeProcessed;
          
          if (File_Write(&outFile, outBuffer + offset, &processedSize) != 0 || processedSize != outSizeProcessed)
          {
            PrintError("can not write output file");
            res = SZ_ERROR_FAIL;
            break;
          }
          
          if (File_Close(&outFile))
          {
            PrintError("can not close output file");
            res = SZ_ERROR_FAIL;
            break;
          }
          
          #ifdef USE_WINDOWS_FILE
          if (SzBitWithVals_Check(&db.Attribs, i))
            SetFileAttributesW(destPath, db.Attribs.Vals[i]);
          #endif
        }
        printf("\n");
      }
      IAlloc_Free(&allocImp, outBuffer);
    }
  }

  SzArEx_Free(&db, &allocImp);
  SzFree(NULL, temp);

  File_Close(&archiveStream.file);
  
  if (res == SZ_OK)
  {
    printf("\nEverything is Ok\n");
    return 0;
  }
  
  if (res == SZ_ERROR_UNSUPPORTED)
    PrintError("decoder doesn't support this archive");
  else if (res == SZ_ERROR_MEM)
    PrintError("can not allocate memory");
  else if (res == SZ_ERROR_CRC)
    PrintError("CRC error");
  else
    printf("\nERROR #%d\n", res);
  
  return 1;
}
开发者ID:DDabble,项目名称:RS_DailyRoutineHelper,代码行数:101,代码来源:7zMain.c



注:本文中的IAlloc_Free函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IAmVeklor函数代码示例发布时间:2022-05-30
下一篇:
C++ I915_WRITE_NOTRACE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap