Home
last modified time | relevance | path

Searched refs:PyMem_Malloc (Results 1 – 25 of 87) sorted by relevance

1234

/third_party/python/Include/
Dpymem.h52 PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
69 ( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
85 #define PyMem_MALLOC(n) PyMem_Malloc(n)
/third_party/python/Python/
Dpyarena.c81 block *b = (block *)PyMem_Malloc(sizeof(block) + size); in block_new()
131 PyArena* arena = (PyArena *)PyMem_Malloc(sizeof(PyArena)); in _PyArena_New()
Dpystrtod.c258 copy = (char *)PyMem_Malloc(end - digits_pos + in _PyOS_ascii_strtod()
399 dup = PyMem_Malloc(orig_len + 1); in _Py_string_to_number_with_underscores()
895 buf = PyMem_Malloc(bufsize); in PyOS_double_to_string()
1037 buf = (char *)PyMem_Malloc(bufsize); in format_float_short()
1164 buf = (char *)PyMem_Malloc(bufsize); in format_float_short()
Dhashtable.c324 alloc.malloc = PyMem_Malloc; in _Py_hashtable_new_full()
Dfileutils.c329 result = PyMem_Malloc(len + 1); in encode_ascii()
729 result = PyMem_Malloc(size); in encode_current_locale()
966 wchar_t* target = PyMem_Malloc(size * sizeof(wchar_t)); in _Py_ConvertWCharForm()
/third_party/python/Doc/c-api/
Dmemory.rst126 :c:func:`PyMem_Free` must be used to free memory allocated using :c:func:`PyMem_Malloc`.
213 .. c:function:: void* PyMem_Malloc(size_t n)
219 if ``PyMem_Malloc(1)`` had been called instead. The memory will not have
241 If *p* is ``NULL``, the call is equivalent to ``PyMem_Malloc(n)``; else if *n*
246 :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`.
255 previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or
267 Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes of
378 Configuration Name PyMem_RawMalloc PyMem_Malloc P…
445 * :c:func:`PyMem_Malloc`,
512 called on a memory block allocated by :c:func:`PyMem_Malloc`.
[all …]
/third_party/python/Modules/_ctypes/
Dstgdict.c93 dst->format = PyMem_Malloc(strlen(src->format) + 1); in PyCStgDict_clone()
101 dst->shape = PyMem_Malloc(sizeof(Py_ssize_t) * src->ndim); in PyCStgDict_clone()
113 dst->ffi_type_pointer.elements = PyMem_Malloc(size); in PyCStgDict_clone()
576 buf = PyMem_Malloc(len + 2 + 1); in PyCStructUnionType_update_stgdict()
781 type_block = PyMem_Malloc(alloc_size); in PyCStructUnionType_update_stgdict()
/third_party/python/Modules/
D_testbuffer.c126 ndbuf = PyMem_Malloc(sizeof *ndbuf); in ndbuf_new()
137 ndbuf->data = PyMem_Malloc(len); in ndbuf_new()
553 mem = PyMem_Malloc(dest->shape[dest->ndim-1] * dest->itemsize); in copy_buffer()
708 item = PyMem_Malloc(base->itemsize); in ndarray_as_list()
809 fmt = PyMem_Malloc(PyBytes_GET_SIZE(tmp)+1); in get_format()
892 s = PyMem_Malloc(base->ndim * (sizeof *s)); in strides_from_shape()
1048 data = PyMem_Malloc(ndbuf->len + addsize); in init_suboffsets()
1083 base->suboffsets = PyMem_Malloc(base->ndim * (sizeof *base->suboffsets)); in init_suboffsets()
1746 shape = PyMem_Malloc(base->ndim * (sizeof *shape)); in copy_structure()
1747 strides = PyMem_Malloc(base->ndim * (sizeof *strides)); in copy_structure()
[all …]
D_lsprof.c194 self = (ProfilerEntry*) PyMem_Malloc(sizeof(ProfilerEntry)); in newProfilerEntry()
235 self = (ProfilerSubEntry*) PyMem_Malloc(sizeof(ProfilerSubEntry)); in newSubEntry()
364 PyMem_Malloc(sizeof(ProfilerContext)); in ptrace_enter_call()
D_randommodule.c316 key = (uint32_t *)PyMem_Malloc((size_t)4 * keyused); in random_seed()
492 wordarray = (uint32_t *)PyMem_Malloc(words * 4); in _random_Random_getrandbits_impl()
D_zoneinfo.c909 PyMem_Malloc(self->num_transitions * sizeof(int64_t)); in load_data()
913 trans_idx = PyMem_Malloc(self->num_transitions * sizeof(Py_ssize_t)); in load_data()
950 utcoff = PyMem_Malloc(self->num_ttinfos * sizeof(long)); in load_data()
951 isdst = PyMem_Malloc(self->num_ttinfos * sizeof(unsigned char)); in load_data()
997 self->_ttinfos = PyMem_Malloc(self->num_ttinfos * sizeof(_ttinfo)); in load_data()
2067 trans_local[i] = PyMem_Malloc(num_transitions * sizeof(int64_t)); in ts_to_local()
2267 StrongCacheNode *node = PyMem_Malloc(sizeof(StrongCacheNode)); in strong_cache_node_new()
Datexitmodule.c165 atexit_callback *callback = PyMem_Malloc(sizeof(atexit_callback)); in atexit_register()
D_scproxy.c33 buf = PyMem_Malloc(len*4); in cfstring_to_pystring()
D_tkinter.c408 q = buf = (char *)PyMem_Malloc(size); in unicodeFromTclStringAndSize()
762 argv0 = (char*)PyMem_Malloc(strlen(className) + 1); in Tkapp_New()
796 args = (char*)PyMem_Malloc(len); in Tkapp_New()
1128 argv = (Tcl_Obj **) PyMem_Malloc(((size_t)size) * sizeof(Tcl_Obj *)); in AsObj()
1239 bytes = PyMem_Malloc(numBytes); in fromBignumObj()
1423 objv = (Tcl_Obj **)PyMem_Malloc(((size_t)objc) * sizeof(Tcl_Obj *)); in Tkapp_CallArgs()
/third_party/python/Modules/_io/
Dwinconsoleio.c533 wchar_t *buf = (wchar_t*)PyMem_Malloc(maxlen * sizeof(wchar_t)); in read_console_w()
615 buf = (wchar_t *)PyMem_Malloc(sizeof(wchar_t)); in read_console_w()
791 buf = (wchar_t*)PyMem_Malloc((bufsize + 1) * sizeof(wchar_t)); in _io__WindowsConsoleIO_readall_impl()
996 wbuf = (wchar_t*)PyMem_Malloc(wlen * sizeof(wchar_t)); in _io__WindowsConsoleIO_write_impl()
/third_party/python/Parser/
Dtokenizer.c53 struct tok_state *tok = (struct tok_state *)PyMem_Malloc( in tok_new()
96 char* result = (char *)PyMem_Malloc(len + 1); in new_string()
600 buf = PyMem_Malloc(needed_length); in translate_newlines()
759 if ((tok->buf = (char *)PyMem_Malloc(BUFSIZ)) == NULL) { in PyTokenizer_FromFile()
878 newtok = PyMem_Malloc(buflen+1); in tok_underflow_interactive()
2111 encoding = (char *)PyMem_Malloc(strlen(tok->encoding) + 1); in PyTokenizer_FindEncodingFilename()
Dmyreadline.c403 res = PyMem_Malloc(len); in PyOS_Readline()
Dpegen.c474 char *new_errmsg = PyMem_Malloc(len + 1); // Lengths of both strings plus NULL character in _PyPegen_raise_error_known_location()
647 arr->items = PyMem_Malloc(initial_size * sizeof(*arr->items)); in growable_comment_array_init()
750 char *tag = PyMem_Malloc(len + 1); in _PyPegen_fill_token()
1081 dup = PyMem_Malloc(strlen(s) + 1); in parsenumber()
1204 Parser *p = PyMem_Malloc(sizeof(Parser)); in _PyPegen_Parser_New()
1215 p->tokens = PyMem_Malloc(sizeof(Token *)); in _PyPegen_Parser_New()
Dparser.c21939 void **_children = PyMem_Malloc(sizeof(void *)); in _loop0_1_rule()
22008 void **_children = PyMem_Malloc(sizeof(void *)); in _loop0_2_rule()
22077 void **_children = PyMem_Malloc(sizeof(void *)); in _loop0_4_rule()
22197 void **_children = PyMem_Malloc(sizeof(void *)); in _loop0_6_rule()
22317 void **_children = PyMem_Malloc(sizeof(void *)); in _loop0_8_rule()
22437 void **_children = PyMem_Malloc(sizeof(void *)); in _loop0_10_rule()
22557 void **_children = PyMem_Malloc(sizeof(void *)); in _loop1_11_rule()
22631 void **_children = PyMem_Malloc(sizeof(void *)); in _loop0_13_rule()
23223 void **_children = PyMem_Malloc(sizeof(void *)); in _loop1_22_rule()
23413 void **_children = PyMem_Malloc(sizeof(void *)); in _loop0_26_rule()
[all …]
/third_party/python/Modules/_multiprocessing/
Dsemaphore.c496 name_copy = PyMem_Malloc(strlen(name) + 1); in _multiprocessing_SemLock_impl()
549 name_copy = PyMem_Malloc(strlen(name) + 1); in _multiprocessing_SemLock__rebuild_impl()
/third_party/python/Objects/
Dmemoryobject.c402 mem = PyMem_Malloc(dest->shape[0] * dest->itemsize); in copy_single()
434 mem = PyMem_Malloc(dest->shape[dest->ndim-1] * dest->itemsize); in copy_buffer()
492 strides = PyMem_Malloc(src->ndim * (sizeof *src->strides)); in buffer_to_contiguous()
818 char *cp = PyMem_Malloc(strlen(fmt)+1); in mbuf_copy_format()
1004 fb = PyMem_Malloc(sizeof *fb + 3 * src->ndim * (sizeof *fb->array)); in PyBuffer_ToContiguous()
1931 struct unpacker *x = PyMem_Malloc(sizeof *x); in unpacker_new()
1992 x->item = PyMem_Malloc(itemsize); in struct_get_unpacker()
2963 mem = PyMem_Malloc(view->len); in memory_hash()
Dcapsule.c201 char *name_dup = (char *)PyMem_Malloc(name_length); in PyCapsule_Import()
Dcall.c418 stack = PyMem_Malloc((argcount + 1) * sizeof(PyObject *)); in _PyObject_Call_Prepend()
717 stack = PyMem_Malloc(nargs * sizeof(stack[0])); in object_vacall()
909 PyObject **stack = PyMem_Malloc((1 + nargs + nkwargs) * sizeof(args[0])); in _PyStack_UnpackDict()
Dmoduleobject.c222 m->md_state = PyMem_Malloc(module->m_size); in _PyModule_CreateInitialized()
388 md->md_state = PyMem_Malloc(def->m_size); in PyModule_ExecDef()
/third_party/python/PC/
Dwinreg.c1193 retDataBuf = (BYTE *)PyMem_Malloc(retDataSize); in winreg_EnumValue_impl()
1524 retBuf = (wchar_t *) PyMem_Malloc(bufSize); in winreg_QueryValue_impl()
1593 retBuf = (BYTE *)PyMem_Malloc(bufSize); in winreg_QueryValueEx_impl()

1234