Module Partition_object_files
Partitioning object files into size-limited buckets.
This module partitions a list of files with their sizes into buckets, where each bucket's total size is at most a configurable threshold.
Errors that can occur during file partitioning.
exception Error of Partition_object_files.errorException wrapper for partitioning errors.
val report_error :
Stdlib.Format.formatter ->
Partition_object_files.error ->
unitPretty-print a partitioning error.
val partition_files :
threshold:int64 ->
Measure_object_files.File_size.t list ->
Partition.t listpartition_files ~threshold file_sizes partitions files into buckets, starting a new bucket when adding the next file would exceed threshold. The order of files is preserved.
The input should only contain files destined for partitioning (OCaml files, startup object, cached genfns). Passthrough files (C stubs, runtime libs) should be handled separately by the caller.
Raises Error (File_exceeds_partition_size _) if any single file exceeds the threshold.