zstd_preSplit.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
  2. /*
  3. * Copyright (c) Meta Platforms, Inc. and affiliates.
  4. * All rights reserved.
  5. *
  6. * This source code is licensed under both the BSD-style license (found in the
  7. * LICENSE file in the root directory of this source tree) and the GPLv2 (found
  8. * in the COPYING file in the root directory of this source tree).
  9. * You may select, at your option, one of the above-listed licenses.
  10. */
  11. #ifndef ZSTD_PRESPLIT_H
  12. #define ZSTD_PRESPLIT_H
  13. #include <linux/types.h> /* size_t */
  14. #define ZSTD_SLIPBLOCK_WORKSPACESIZE 8208
  15. /* ZSTD_splitBlock():
  16. * @level must be a value between 0 and 4.
  17. * higher levels spend more energy to detect block boundaries.
  18. * @workspace must be aligned for size_t.
  19. * @wkspSize must be at least >= ZSTD_SLIPBLOCK_WORKSPACESIZE
  20. * note:
  21. * For the time being, this function only accepts full 128 KB blocks.
  22. * Therefore, @blockSize must be == 128 KB.
  23. * While this could be extended to smaller sizes in the future,
  24. * it is not yet clear if this would be useful. TBD.
  25. */
  26. size_t ZSTD_splitBlock(const void* blockStart, size_t blockSize,
  27. int level,
  28. void* workspace, size_t wkspSize);
  29. #endif /* ZSTD_PRESPLIT_H */