MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / mz_zip_writer_init_heap

Function mz_zip_writer_init_heap

SampleFramework12/v1.00/TinyEXR.cpp:5553–5570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5551}
5552
5553mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip,
5554 size_t size_to_reserve_at_beginning,
5555 size_t initial_allocation_size) {
5556 pZip->m_pWrite = mz_zip_heap_write_func;
5557 pZip->m_pIO_opaque = pZip;
5558 if (!mz_zip_writer_init(pZip, size_to_reserve_at_beginning))
5559 return MZ_FALSE;
5560 if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size,
5561 size_to_reserve_at_beginning))) {
5562 if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(
5563 pZip->m_pAlloc_opaque, 1, initial_allocation_size))) {
5564 mz_zip_writer_end(pZip);
5565 return MZ_FALSE;
5566 }
5567 pZip->m_pState->m_mem_capacity = initial_allocation_size;
5568 }
5569 return MZ_TRUE;
5570}
5571
5572#ifndef MINIZ_NO_STDIO
5573static size_t mz_zip_file_write_func(void *pOpaque, mz_uint64 file_ofs,

Callers

nothing calls this directly

Calls 2

mz_zip_writer_initFunction · 0.85
mz_zip_writer_endFunction · 0.85

Tested by

no test coverage detected