Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_tracemalloc.c: compiler warning with gil_state #63956

Closed
vstinner opened this issue Nov 24, 2013 · 3 comments
Closed

_tracemalloc.c: compiler warning with gil_state #63956

vstinner opened this issue Nov 24, 2013 · 3 comments

Comments

@vstinner
Copy link
Member

BPO 19757
Nosy @vstinner, @tiran, @koobs
Files
  • cleanup.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-12-04.00:29:48.855>
    created_at = <Date 2013-11-24.18:26:57.739>
    labels = []
    title = '_tracemalloc.c: compiler warning with gil_state'
    updated_at = <Date 2013-12-04.00:29:48.854>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2013-12-04.00:29:48.854>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-12-04.00:29:48.855>
    closer = 'python-dev'
    components = []
    creation = <Date 2013-11-24.18:26:57.739>
    creator = 'vstinner'
    dependencies = []
    files = ['32878']
    hgrepos = []
    issue_num = 19757
    keywords = ['patch']
    message_count = 3.0
    messages = ['204254', '204633', '205180']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'christian.heimes', 'python-dev', 'koobs']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue19757'
    versions = ['Python 3.4']

    @vstinner
    Copy link
    Member Author

    Clang complains that gil_state might be used uninitialized in _tracemalloc.c:488 and 533.

    @vstinner
    Copy link
    Member Author

    Hum, Clang is not kind enough to understand that gil_state is not used when uninitialized.

    Well, I always hesitated to refactor the code. So here is a cleanup which moves PyGILState_Ensure/PyGILState_Release to the caller. It duplicates a few lines of code, but the new code should be more readable.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Dec 4, 2013

    New changeset 194f74044537 by Victor Stinner in branch 'default':
    Close bpo-19757: Cleanup tracemalloc, move
    http://hg.python.org/cpython/rev/194f74044537

    @python-dev python-dev mannequin closed this as completed Dec 4, 2013
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant