def METHOD_NAME(stream):
    """Write glib malloc's malloc_info(3)"""
    with tempfile.NamedTemporaryFile('wb+') as fp:
        if not lib.malloc_info(0, fp.file):
            fp.seek(0)
            stream.writelines(fp.readlines())