diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-20 21:02:53 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-21 20:47:02 +0100 |
commit | b263a4003aecc0d1f8190a4f5ff2b749c7ad5651 (patch) | |
tree | fc8b349a19a5d686a4519c39c2aced9c307e41bc /tools | |
parent | 60a11cfaec3ad560cd7fcedf618001bd9c756b1c (diff) |
fix chunking logic to generate >1 chunk
Diffstat (limited to 'tools')
-rw-r--r-- | tools/shared.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/shared.py b/tools/shared.py index e8767e40..95ec15b9 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -1253,13 +1253,17 @@ class JCache: funcs = spilled # we will allocate these into chunks as if they were normal inputs # initialize reasonably, the rest of the funcs we need to split out curr = [] + total_size = 0 for i in range(len(funcs)): func = funcs[i] - if len(curr) + len(func[1]) < chunk_size: + curr_size = len(func[1]) + if total_size + curr_size < chunk_size: curr.append(func) + total_size += curr_size else: chunks.append(curr) curr = [func] + total_size = curr_size if curr: chunks.append(curr) curr = None |