Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Modules/_remote_debugging/binary_io_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ binary_writer_create(const char *filename, uint64_t sample_interval_us, int comp

writer->write_buffer = PyMem_Malloc(WRITE_BUFFER_SIZE);
if (!writer->write_buffer) {
PyErr_NoMemory();
goto error;
}
writer->buffer_size = WRITE_BUFFER_SIZE;
Expand All @@ -753,14 +754,17 @@ binary_writer_create(const char *filename, uint64_t sample_interval_us, int comp
NULL /* Use default allocator */
);
if (!writer->string_hash) {
PyErr_NoMemory();
goto error;
}
writer->strings = PyMem_Malloc(INITIAL_STRING_CAPACITY * sizeof(char *));
if (!writer->strings) {
PyErr_NoMemory();
goto error;
}
writer->string_lengths = PyMem_Malloc(INITIAL_STRING_CAPACITY * sizeof(size_t));
if (!writer->string_lengths) {
PyErr_NoMemory();
goto error;
}
writer->string_capacity = INITIAL_STRING_CAPACITY;
Expand All @@ -773,16 +777,19 @@ binary_writer_create(const char *filename, uint64_t sample_interval_us, int comp
NULL /* Use default allocator */
);
if (!writer->frame_hash) {
PyErr_NoMemory();
goto error;
}
writer->frame_entries = PyMem_Malloc(INITIAL_FRAME_CAPACITY * sizeof(FrameEntry));
if (!writer->frame_entries) {
PyErr_NoMemory();
goto error;
}
writer->frame_capacity = INITIAL_FRAME_CAPACITY;

writer->thread_entries = PyMem_Malloc(INITIAL_THREAD_CAPACITY * sizeof(ThreadEntry));
if (!writer->thread_entries) {
PyErr_NoMemory();
goto error;
}
writer->thread_capacity = INITIAL_THREAD_CAPACITY;
Expand Down
Loading