aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py6
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