当前位置: 首页>>代码示例>>C++>>正文


C++ IAlloc_Free函数代码示例

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


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


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