| 322 | std::size_t MallocExtension_GetAllocatedSize(const void* p) { return 0; } |
| 323 | |
| 324 | bool Snappy_Compress(const char* input, size_t length, string* output) { |
| 325 | #ifdef TF_USE_SNAPPY |
| 326 | output->resize(snappy::MaxCompressedLength(length)); |
| 327 | size_t outlen; |
| 328 | snappy::RawCompress(input, length, &(*output)[0], &outlen); |
| 329 | output->resize(outlen); |
| 330 | return true; |
| 331 | #else |
| 332 | return false; |
| 333 | #endif |
| 334 | } |
| 335 | |
| 336 | bool Snappy_GetUncompressedLength(const char* input, size_t length, |
| 337 | size_t* result) { |