aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Python/asdl.c
diff options
context:
space:
mode:
authororivej <orivej@yandex-team.ru>2022-02-10 16:44:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:49 +0300
commit718c552901d703c502ccbefdfc3c9028d608b947 (patch)
tree46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/tools/python3/src/Python/asdl.c
parente9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff)
downloadydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Python/asdl.c')
-rw-r--r--contrib/tools/python3/src/Python/asdl.c128
1 files changed, 64 insertions, 64 deletions
diff --git a/contrib/tools/python3/src/Python/asdl.c b/contrib/tools/python3/src/Python/asdl.c
index c211078118..c21ca28da3 100644
--- a/contrib/tools/python3/src/Python/asdl.c
+++ b/contrib/tools/python3/src/Python/asdl.c
@@ -1,64 +1,64 @@
-#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;
-}
+#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;
+}