This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: COUNT_ALLOCS build export inc_count() and dec_count() functions which don't have a "Py_" prefix
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2018-10-25 10:13 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10152 merged pablogsal, 2018-10-27 14:16
Messages (2)
msg328422 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-10-25 10:13
Extract of Include/object.c:

#ifdef COUNT_ALLOCS
PyAPI_FUNC(void) inc_count(PyTypeObject *);
PyAPI_FUNC(void) dec_count(PyTypeObject *);

The "make smelly" fails with 10 symbols:

---
$ ./configure --with-pydebug CFLAGS="-D COUNT_ALLOCS -O0"
$ make smelly
(...)
./python Tools/scripts/smelly.py
+ nm -p libpython3.8dm.a
Ignored symbol types: b, d, r, t

Smelly symbol: dec_count (type: T)
Smelly symbol: dump_counts (type: T)
Smelly symbol: fast_tuple_allocs (type: C)
Smelly symbol: get_counts (type: T)
Smelly symbol: inc_count (type: T)
Smelly symbol: null_strings (type: C)
Smelly symbol: one_strings (type: C)
Smelly symbol: quick_int_allocs (type: C)
Smelly symbol: quick_neg_int_allocs (type: C)
Smelly symbol: tuple_zero_allocs (type: C)

ERROR: Found 10 smelly symbols!
---

These functions should be made private (declared with "static") or get a "Py_" prefix.
msg328689 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-10-28 15:02
New changeset 49c75a8086c3df9add0779d2479b8f09b95cdf3b by Pablo Galindo in branch 'master':
bpo-35064 prefix smelly symbols that appear with COUNT_ALLOCS with _Py_ (GH-10152)
https://github.com/python/cpython/commit/49c75a8086c3df9add0779d2479b8f09b95cdf3b
History
Date User Action Args
2022-04-11 14:59:07adminsetgithub: 79245
2018-10-28 15:02:41pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-10-28 15:02:21pablogsalsetmessages: + msg328689
2018-10-27 14:16:19pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request9478
2018-10-26 00:48:10pablogsalsetnosy: + pablogsal
2018-10-25 10:13:55vstinnercreate