We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4107acf commit e03b2f8Copy full SHA for e03b2f8
graalpython/com.oracle.graal.python.cext/src/obmalloc.c
@@ -109,6 +109,13 @@ void* PyMem_Malloc(size_t size) {
109
return ptr;
110
}
111
112
+void* PyMem_Calloc(size_t nelem, size_t elsize) {
113
+ if (elsize != 0 && nelem > (size_t)PY_SSIZE_T_MAX / elsize) {
114
+ return NULL;
115
+ }
116
+ return PyMem_RawCalloc(nelem, elsize);
117
+}
118
+
119
void* PyMem_RawMalloc(size_t size) {
120
mem_head_t* ptr_with_head = malloc((size == 0 ? 1 : size) + sizeof(mem_head_t));
121
void* ptr = FROM_MEM_HEAD(ptr_with_head);
0 commit comments