MCPcopy Create free account
hub / github.com/clementgallet/libTAS / LZ4_initStream

Function LZ4_initStream

src/external/lz4.cpp:1357–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1355#endif
1356
1357LZ4_stream_t* LZ4_initStream (void* buffer, size_t size)
1358{
1359 DEBUGLOG(5, "LZ4_initStream");
1360 if (buffer == NULL) { return NULL; }
1361 if (size < sizeof(LZ4_stream_t)) { return NULL; }
1362#ifndef _MSC_VER /* for some reason, Visual fails the aligment test on 32-bit x86 :
1363 it reports an aligment of 8-bytes,
1364 while actually aligning LZ4_stream_t on 4 bytes. */
1365 if (((size_t)buffer) & (LZ4_stream_t_alignment() - 1)) { return NULL; } /* alignment check */
1366#endif
1367 MEM_INIT(buffer, 0, sizeof(LZ4_stream_t));
1368 return (LZ4_stream_t*)buffer;
1369}
1370
1371/* resetStream is now deprecated,
1372 * prefer initStream() which is more general */

Callers 5

SaveStateSavingMethod · 0.85
LZ4_compress_fast_forceFunction · 0.85
LZ4_createStreamFunction · 0.85

Calls 1

LZ4_stream_t_alignmentFunction · 0.85

Tested by

no test coverage detected