Message350883
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 :-) |
|
Date |
User |
Action |
Args |
2019-08-30 14:53:53 | vstinner | set | recipients:
+ vstinner, jd |
2019-08-30 14:53:53 | vstinner | set | messageid: <1567176833.95.0.0946803132139.issue37961@roundup.psfhosted.org> |
2019-08-30 14:53:53 | vstinner | link | issue37961 messages |
2019-08-30 14:53:53 | vstinner | create | |
|