本文整理汇总了Python中pypy.rpython.memory.gc.semispace.SemiSpaceGC.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python SemiSpaceGC.__init__方法的具体用法?Python SemiSpaceGC.__init__怎么用?Python SemiSpaceGC.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.rpython.memory.gc.semispace.SemiSpaceGC
的用法示例。
在下文中一共展示了SemiSpaceGC.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pypy.rpython.memory.gc.semispace import SemiSpaceGC [as 别名]
# 或者: from pypy.rpython.memory.gc.semispace.SemiSpaceGC import __init__ [as 别名]
def __init__(self, chunk_size=DEFAULT_CHUNK_SIZE,
nursery_size=128,
min_nursery_size=128,
auto_nursery_size=False,
space_size=4096,
max_space_size=sys.maxint//2+1):
SemiSpaceGC.__init__(self, chunk_size = chunk_size,
space_size = space_size,
max_space_size = max_space_size)
assert min_nursery_size <= nursery_size <= space_size // 2
self.initial_nursery_size = nursery_size
self.auto_nursery_size = auto_nursery_size
self.min_nursery_size = min_nursery_size
self.old_objects_pointing_to_young = self.AddressStack()
# ^^^ a list of addresses inside the old objects space; it
# may contain static prebuilt objects as well. More precisely,
# it lists exactly the old and static objects whose
# GCFLAG_NO_YOUNG_PTRS bit is not set.
self.young_objects_with_weakrefs = self.AddressStack()
self.reset_nursery()
# compute the constant lower bounds for the attributes
# largest_young_fixedsize and largest_young_var_basesize.
# It is expected that most (or all) objects have a fixedsize
# that is much lower anyway.
sz = self.get_young_fixedsize(self.min_nursery_size)
self.lb_young_fixedsize = sz
sz = self.get_young_var_basesize(self.min_nursery_size)
self.lb_young_var_basesize = sz
示例2: __init__
# 需要导入模块: from pypy.rpython.memory.gc.semispace import SemiSpaceGC [as 别名]
# 或者: from pypy.rpython.memory.gc.semispace.SemiSpaceGC import __init__ [as 别名]
def __init__(self, config, chunk_size=DEFAULT_CHUNK_SIZE,
nursery_size=128,
min_nursery_size=128,
auto_nursery_size=False,
space_size=4096,
max_space_size=sys.maxint//2+1):
SemiSpaceGC.__init__(self, config, chunk_size = chunk_size,
space_size = space_size,
max_space_size = max_space_size)
assert min_nursery_size <= nursery_size <= space_size // 2
self.initial_nursery_size = nursery_size
self.auto_nursery_size = auto_nursery_size
self.min_nursery_size = min_nursery_size
# define nursery fields
self.reset_nursery()
self._setup_wb()
# compute the constant lower bounds for the attributes
# largest_young_fixedsize and largest_young_var_basesize.
# It is expected that most (or all) objects have a fixedsize
# that is much lower anyway.
sz = self.get_young_fixedsize(self.min_nursery_size)
self.lb_young_fixedsize = sz
sz = self.get_young_var_basesize(self.min_nursery_size)
self.lb_young_var_basesize = sz