Commit 9d2837ab authored by Stefan Behnel's avatar Stefan Behnel

use freelists for closure classes

parent 48a3ef68
......@@ -67,6 +67,9 @@ cimport_from_pyx = False
# slices are passed by value and involve a lot of copying
buffer_max_dims = 8
# Number of function closure instances to keep in a freelist (0: no freelists)
closure_freelist_size = 8
# Declare compiler directives
directive_defaults = {
'boundscheck' : True,
......
......@@ -2248,6 +2248,8 @@ class CreateClosureClasses(CythonTransform):
func_scope.scope_class = entry
class_scope = entry.type.scope
class_scope.is_internal = True
if Options.closure_freelist_size:
class_scope.directives['freelist'] = Options.closure_freelist_size
if from_closure:
assert cscope.is_closure_scope
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment