Differential D3095 Diff 13993 libraries/source/spidermonkey/include-win32-debug/mozilla/Compression.h
Changeset View
Changeset View
Standalone View
Standalone View
libraries/source/spidermonkey/include-win32-debug/mozilla/Compression.h
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | public: | ||||
* compression fails | * compression fails | ||||
*/ | */ | ||||
static MFBT_API size_t | static MFBT_API size_t | ||||
compressLimitedOutput(const char* aSource, size_t aInputSize, char* aDest, | compressLimitedOutput(const char* aSource, size_t aInputSize, char* aDest, | ||||
size_t aMaxOutputSize); | size_t aMaxOutputSize); | ||||
/** | /** | ||||
* If the source stream is malformed, the function will stop decoding | * If the source stream is malformed, the function will stop decoding | ||||
* and return a negative result, indicating the byte position of the | * and return false. | ||||
* faulty instruction | |||||
* | * | ||||
* This function never writes outside of provided buffers, and never | * This function never writes outside of provided buffers, and never | ||||
* modifies input buffer. | * modifies input buffer. | ||||
* | * | ||||
* Note: destination buffer must be already allocated, and its size must be a | * Note: destination buffer must be already allocated, and its size must be a | ||||
* minimum of |aOutputSize| bytes. | * minimum of |aOutputSize| bytes. | ||||
* | * | ||||
* @param aOutputSize is the output size, therefore the original size | * @param aOutputSize is the output size, therefore the original size | ||||
* @return the number of bytes read in the source buffer | * @return true on success, false on failure | ||||
*/ | */ | ||||
static MFBT_API bool | static MFBT_API MOZ_MUST_USE bool | ||||
decompress(const char* aSource, char* aDest, size_t aOutputSize); | decompress(const char* aSource, char* aDest, size_t aOutputSize); | ||||
/** | /** | ||||
* If the source stream is malformed, the function will stop decoding | * If the source stream is malformed, the function will stop decoding | ||||
* and return false. | * and return false. | ||||
* | * | ||||
* This function never writes beyond aDest + aMaxOutputSize, and is | * This function never writes beyond aDest + aMaxOutputSize, and is | ||||
* therefore protected against malicious data packets. | * therefore protected against malicious data packets. | ||||
* | * | ||||
* Note: Destination buffer must be already allocated. This version is | * Note: Destination buffer must be already allocated. This version is | ||||
* slightly slower than the decompress without the aMaxOutputSize. | * slightly slower than the decompress without the aMaxOutputSize. | ||||
* | * | ||||
* @param aInputSize is the length of the input compressed data | * @param aInputSize is the length of the input compressed data | ||||
* @param aMaxOutputSize is the size of the destination buffer (which must be | * @param aMaxOutputSize is the size of the destination buffer (which must be | ||||
* already allocated) | * already allocated) | ||||
* @param aOutputSize the actual number of bytes decoded in the destination | * @param aOutputSize the actual number of bytes decoded in the destination | ||||
* buffer (necessarily <= aMaxOutputSize) | * buffer (necessarily <= aMaxOutputSize) | ||||
* @return true on success, false on failure | |||||
*/ | */ | ||||
static MFBT_API bool | static MFBT_API MOZ_MUST_USE bool | ||||
decompress(const char* aSource, size_t aInputSize, char* aDest, | decompress(const char* aSource, size_t aInputSize, char* aDest, | ||||
size_t aMaxOutputSize, size_t* aOutputSize); | size_t aMaxOutputSize, size_t* aOutputSize); | ||||
/* | /* | ||||
* Provides the maximum size that LZ4 may output in a "worst case" | * Provides the maximum size that LZ4 may output in a "worst case" | ||||
* scenario (input data not compressible) primarily useful for memory | * scenario (input data not compressible) primarily useful for memory | ||||
* allocation of output buffer. | * allocation of output buffer. | ||||
* note : this function is limited by "int" range (2^31-1) | * note : this function is limited by "int" range (2^31-1) | ||||
Show All 16 Lines |
Wildfire Games · Phabricator