File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,7 @@ typedef struct tracemalloc_traceback traceback_t;
48
48
#define TRACEBACK_SIZE (NFRAME ) \
49
49
(sizeof(traceback_t) + sizeof(frame_t) * (NFRAME - 1))
50
50
51
- /* The maximum number of frames is either:
52
- - The maximum number of frames we can store in `traceback_t.nframe`
53
- - The maximum memory size_t we can allocate */
54
- static const unsigned long MAX_NFRAME = Py_MIN (UINT16_MAX , ((SIZE_MAX - sizeof (traceback_t )) / sizeof (frame_t ) + 1 ));
51
+ static const int MAX_NFRAME = UINT16_MAX ;
55
52
56
53
57
54
#define tracemalloc_empty_traceback _PyRuntime.tracemalloc.empty_traceback
@@ -783,9 +780,9 @@ tracemalloc_deinit(void)
783
780
int
784
781
_PyTraceMalloc_Start (int max_nframe )
785
782
{
786
- if (max_nframe < 1 || ( unsigned long ) max_nframe > MAX_NFRAME ) {
783
+ if (max_nframe < 1 || max_nframe > MAX_NFRAME ) {
787
784
PyErr_Format (PyExc_ValueError ,
788
- "the number of frames must be in range [1; %lu ]" ,
785
+ "the number of frames must be in range [1; %i ]" ,
789
786
MAX_NFRAME );
790
787
return -1 ;
791
788
}
You can’t perform that action at this time.
0 commit comments