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.

Author vstinner
Recipients jd, vstinner
Date 2019-08-30.14:53:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1567176833.95.0.0946803132139.issue37961@roundup.psfhosted.org>
In-reply-to
Content
With the following change, traceback_t size changes from 24 bytes to 32 bytes:

diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index ee32ac29b7..8a820db907 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -79,6 +79,7 @@ __attribute__((packed))
 typedef struct {
     Py_uhash_t hash;
     int nframe;
+    int length;
     frame_t frames[1];
 } traceback_t;
 
@@ -1640,6 +1641,8 @@ PyInit__tracemalloc(void)
     if (tracemalloc_init() < 0)
         return NULL;
 
+    printf("sizeof(traceback_t) = %zu bytes\n", sizeof(traceback_t));
+
     return m;
 }


The following structure size is 24 bytes, so no change:

typedef struct {
    Py_uhash_t hash;
    short nframe;
    short length;
    frame_t frames[1];
} traceback_t;

The short approach is promising :-)
History
Date User Action Args
2019-08-30 14:53:53vstinnersetrecipients: + vstinner, jd
2019-08-30 14:53:53vstinnersetmessageid: <1567176833.95.0.0946803132139.issue37961@roundup.psfhosted.org>
2019-08-30 14:53:53vstinnerlinkissue37961 messages
2019-08-30 14:53:53vstinnercreate