Пример #1
0
    def startup(self, space):
        "This function is called when the program really starts"

        from pypy.module.cpyext.typeobject import setup_new_method_def
        from pypy.module.cpyext.pyobject import RefcountState
        from pypy.module.cpyext.api import INIT_FUNCTIONS

        setup_new_method_def(space)
        if we_are_translated():
            refcountstate = space.fromcache(RefcountState)
            refcountstate.init_r2w_from_w2r()

        for func in INIT_FUNCTIONS:
            func(space)
            self.check_and_raise_exception()
Пример #2
0
    def startup(self, space):
        "This function is called when the program really starts"

        from pypy.module.cpyext.typeobject import setup_new_method_def
        from pypy.module.cpyext.pyobject import RefcountState
        from pypy.module.cpyext.api import INIT_FUNCTIONS

        setup_new_method_def(space)
        if we_are_translated():
            refcountstate = space.fromcache(RefcountState)
            refcountstate.init_r2w_from_w2r()

        for func in INIT_FUNCTIONS:
            func(space)
            self.check_and_raise_exception()
Пример #3
0
    def startup(self, space):
        "This function is called when the program really starts"

        from pypy.module.cpyext.typeobject import setup_new_method_def
        from pypy.module.cpyext.api import INIT_FUNCTIONS
        from pypy.module.cpyext.api import init_static_data_translated

        if we_are_translated():
            rawrefcount.init(llhelper(rawrefcount.RAWREFCOUNT_DEALLOC_TRIGGER,
                                      self.dealloc_trigger))
            init_static_data_translated(space)

        setup_new_method_def(space)

        for func in INIT_FUNCTIONS:
            func(space)
            self.check_and_raise_exception()
Пример #4
0
    def startup(self, space):
        "This function is called when the program really starts"

        from pypy.module.cpyext.typeobject import setup_new_method_def
        from pypy.module.cpyext.api import INIT_FUNCTIONS
        from pypy.module.cpyext.api import init_static_data_translated

        if we_are_translated():
            rawrefcount.init(
                llhelper(rawrefcount.RAWREFCOUNT_DEALLOC_TRIGGER,
                         self.dealloc_trigger))
            init_static_data_translated(space)

        setup_new_method_def(space)

        for func in INIT_FUNCTIONS:
            func(space)
            self.check_and_raise_exception()
Пример #5
0
    def startup(self, space):
        "This function is called when the program really starts"
        from pypy.module.cpyext.typeobject import setup_new_method_def
        from pypy.module.cpyext.api import INIT_FUNCTIONS

        if we_are_translated():
            if space.config.translation.gc != "boehm":
                # This must be called in RPython, the untranslated version
                # does something different. Sigh.
                rawrefcount.init(
                    llhelper(rawrefcount.RAWREFCOUNT_DEALLOC_TRIGGER,
                             self.dealloc_trigger))
            self.builder.attach_all(space)

        setup_new_method_def(space)

        for func in INIT_FUNCTIONS:
            func(space)
            self.check_and_raise_exception()