示例#1
0
文件: link.py 项目: 70599/Waterfox
def measure_link_vsize(output_file, args):
    """
    Execute |args|, and measure the maximum virtual memory usage of the process,
    printing it to stdout when finished.
    """

    # This needs to be a list in order for the callback to set the
    # variable properly with python-2's scoping rules.
    t = [None]
    def callback(proc):
        t[0] = threading.Thread(target=measure_vsize_threadfunc,
                             args=(proc, output_file))
        t[0].start()
    exitcode = expandlibs_exec.main(args, proc_callback=callback)
    # Wait for the background thread to finish.
    t[0].join()
    return exitcode
示例#2
0
def wrap_linker(args):
    """
    Execute |args| and pass resulting |proc| object to a second thread that
    will track the status of the started |proc|.
    """

    # This needs to be a list in order for the callback to set the
    # variable properly with python-2's scoping rules.
    t = [None]
    def callback(proc):
        t[0] = threading.Thread(target=periodically_print_status,
                             args=(proc,))
        t[0].start()
    exitcode = expandlibs_exec.main(args, proc_callback=callback)
    # Wait for the background thread to finish.
    t[0].join()
    return exitcode
示例#3
0
def wrap_linker(args):
    """
    Execute |args| and pass resulting |proc| object to a second thread that
    will track the status of the started |proc|.
    """

    # This needs to be a list in order for the callback to set the
    # variable properly with python-2's scoping rules.
    t = [None]

    def callback(proc):
        t[0] = threading.Thread(target=periodically_print_status,
                                args=(proc, ))
        t[0].start()

    exitcode = expandlibs_exec.main(args, proc_callback=callback)
    # Wait for the background thread to finish.
    t[0].join()
    return exitcode
示例#4
0
文件: link.py 项目: jiusi250/mozjs-33
def measure_link_vsize(output_file, args):
    """
    Execute |args|, and measure the maximum virtual memory usage of the process,
    printing it to stdout when finished.
    """

    # This needs to be a list in order for the callback to set the
    # variable properly with python-2's scoping rules.
    t = [None]

    def callback(proc):
        t[0] = threading.Thread(target=measure_vsize_threadfunc,
                                args=(proc, output_file))
        t[0].start()

    exitcode = expandlibs_exec.main(args, proc_callback=callback)
    # Wait for the background thread to finish.
    t[0].join()
    return exitcode