| 215 | } |
| 216 | |
| 217 | static inline char* EmitCopy(char* op, size_t offset, int len) { |
| 218 | // Emit 64 byte copies but make sure to keep at least four bytes reserved |
| 219 | while (len >= 68) { |
| 220 | op = EmitCopyLessThan64(op, offset, 64); |
| 221 | len -= 64; |
| 222 | } |
| 223 | |
| 224 | // Emit an extra 60 byte copy if have too much data to fit in one copy |
| 225 | if (len > 64) { |
| 226 | op = EmitCopyLessThan64(op, offset, 60); |
| 227 | len -= 60; |
| 228 | } |
| 229 | |
| 230 | // Emit remainder |
| 231 | op = EmitCopyLessThan64(op, offset, len); |
| 232 | return op; |
| 233 | } |
| 234 | |
| 235 | |
| 236 | bool GetUncompressedLength(const char* start, size_t n, size_t* result) { |
no test coverage detected