Staging
v0.5.1
v0.5.1
https://github.com/python/cpython
Revision 2eb1dac46e256e7f9be71021e4630c0a3e9b4b03 authored by Miss Islington (bot) on 01 October 2019, 01:47:13 UTC, committed by Yury Selivanov on 01 October 2019, 01:47:13 UTC
(cherry picked from commit e407013089259e4c0b271703e1975bbcd578a2d5) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
1 parent 1c3e469
Tip revision: 2eb1dac46e256e7f9be71021e4630c0a3e9b4b03 authored by Miss Islington (bot) on 01 October 2019, 01:47:13 UTC
Fix and improve `asyncio.run()` docs (GH-16403) (GH-16505)
Fix and improve `asyncio.run()` docs (GH-16403) (GH-16505)
Tip revision: 2eb1dac
asdl.c
#include "Python.h"
#include "asdl.h"
asdl_seq *
_Py_asdl_seq_new(Py_ssize_t size, PyArena *arena)
{
asdl_seq *seq = NULL;
size_t n;
/* check size is sane */
if (size < 0 ||
(size && (((size_t)size - 1) > (SIZE_MAX / sizeof(void *))))) {
PyErr_NoMemory();
return NULL;
}
n = (size ? (sizeof(void *) * (size - 1)) : 0);
/* check if size can be added safely */
if (n > SIZE_MAX - sizeof(asdl_seq)) {
PyErr_NoMemory();
return NULL;
}
n += sizeof(asdl_seq);
seq = (asdl_seq *)PyArena_Malloc(arena, n);
if (!seq) {
PyErr_NoMemory();
return NULL;
}
memset(seq, 0, n);
seq->size = size;
return seq;
}
asdl_int_seq *
_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena)
{
asdl_int_seq *seq = NULL;
size_t n;
/* check size is sane */
if (size < 0 ||
(size && (((size_t)size - 1) > (SIZE_MAX / sizeof(void *))))) {
PyErr_NoMemory();
return NULL;
}
n = (size ? (sizeof(void *) * (size - 1)) : 0);
/* check if size can be added safely */
if (n > SIZE_MAX - sizeof(asdl_seq)) {
PyErr_NoMemory();
return NULL;
}
n += sizeof(asdl_seq);
seq = (asdl_int_seq *)PyArena_Malloc(arena, n);
if (!seq) {
PyErr_NoMemory();
return NULL;
}
memset(seq, 0, n);
seq->size = size;
return seq;
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...