Home
last modified time | relevance | path

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

1234

/external/python/cpython3/Include/
Dpymem.h48 PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
65 ( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
81 #define PyMem_MALLOC(n) PyMem_Malloc((n))
/external/python/cpython3/Modules/_testcapi/
Dmem.c207 ptr = PyMem_Malloc(size); in test_setallocators()
408 ptr = PyMem_Malloc(0); in test_pymem_alloc0()
478 buffer = PyMem_Malloc(16); in pymem_buffer_overflow()
496 buffer = PyMem_Malloc(16); in pymem_api_misuse()
510 buffer = PyMem_Malloc(10); in pymem_malloc_without_gil()
/external/python/cpython3/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.c219 copy = (char *)PyMem_Malloc(end - digits_pos + in _PyOS_ascii_strtod()
360 dup = PyMem_Malloc(orig_len + 1); in _Py_string_to_number_with_underscores()
856 buf = PyMem_Malloc(bufsize); in PyOS_double_to_string()
1015 buf = (char *)PyMem_Malloc(bufsize); in format_float_short()
1142 buf = (char *)PyMem_Malloc(bufsize); in format_float_short()
Dflowgraph.c417 cfg_builder *g = PyMem_Malloc(sizeof(cfg_builder)); in _PyCfgBuilder_New()
625 basicblock **label2block = (basicblock **)PyMem_Malloc(mapsize); in translate_jump_labels_to_targets()
704 struct _PyCfgExceptStack *new = PyMem_Malloc(sizeof(struct _PyCfgExceptStack)); in make_except_stack()
716 struct _PyCfgExceptStack *copy = PyMem_Malloc(sizeof(struct _PyCfgExceptStack)); in copy_except_stack()
732 basicblock **stack = (basicblock **)PyMem_Malloc(sizeof(basicblock *) * nblocks); in make_cfg_traversal_stack()
1370 int *stack = PyMem_Malloc(depth * sizeof(int)); in swaptimize()
2034 index_map = PyMem_Malloc(nconsts * sizeof(Py_ssize_t)); in remove_unused_consts()
2085 reverse_index_map = PyMem_Malloc(nconsts * sizeof(Py_ssize_t)); in remove_unused_consts()
/external/python/cpython3/Doc/c-api/
Dmemory.rst107 For example, :c:func:`PyMem_Free` must be used to free memory allocated using :c:func:`PyMem_Malloc
130 For example, buffers (non-Python objects) should be allocated using :c:func:`PyMem_Malloc`,
223 .. c:function:: void* PyMem_Malloc(size_t n)
229 if ``PyMem_Malloc(1)`` had been called instead. The memory will not have
251 If *p* is ``NULL``, the call is equivalent to ``PyMem_Malloc(n)``; else if *n*
256 :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`.
265 previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or
277 Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes of
390 Configuration Name PyMem_RawMalloc PyMem_Malloc P…
461 * :c:func:`PyMem_Malloc`,
[all …]
/external/python/cpython3/Modules/_ctypes/
Dstgdict.c46 dst_info->format = PyMem_Malloc(strlen(src_info->format) + 1); in PyCStgInfo_clone()
54 dst_info->shape = PyMem_Malloc(sizeof(Py_ssize_t) * src_info->ndim); in PyCStgInfo_clone()
66 dst_info->ffi_type_pointer.elements = PyMem_Malloc(size); in PyCStgInfo_clone()
519 buf = PyMem_Malloc(len + 2 + 1); in PyCStructUnionType_update_stginfo()
761 type_block = PyMem_Malloc(alloc_size); in PyCStructUnionType_update_stginfo()
/external/python/cpython3/Parser/tokenizer/
Dfile_tokenizer.c217 newtok = PyMem_Malloc(buflen+1); in tok_underflow_interactive()
356 if ((tok->buf = (char *)PyMem_Malloc(BUFSIZ)) == NULL) { in _PyTokenizer_FromFile()
463 encoding = (char *)PyMem_Malloc(strlen(tok->encoding) + 1); in _PyTokenizer_FindEncodingFilename()
Dreadline_tokenizer.c115 if ((tok->buf = (char *)PyMem_Malloc(BUFSIZ)) == NULL) { in _PyTokenizer_FromReadline()
Dhelpers.c183 char* result = (char *)PyMem_Malloc(len + 1); in _PyTokenizer_new_string()
211 buf = PyMem_Malloc(needed_length); in _PyTokenizer_translate_newlines()
/external/python/cpython3/Modules/
D_testbuffer.c123 ndbuf = PyMem_Malloc(sizeof *ndbuf); in ndbuf_new()
134 ndbuf->data = PyMem_Malloc(len); in ndbuf_new()
550 mem = PyMem_Malloc(dest->shape[dest->ndim-1] * dest->itemsize); in copy_buffer()
705 item = PyMem_Malloc(base->itemsize); in ndarray_as_list()
806 fmt = PyMem_Malloc(PyBytes_GET_SIZE(tmp)+1); in get_format()
889 s = PyMem_Malloc(base->ndim * (sizeof *s)); in strides_from_shape()
1045 data = PyMem_Malloc(ndbuf->len + addsize); in init_suboffsets()
1080 base->suboffsets = PyMem_Malloc(base->ndim * (sizeof *base->suboffsets)); in init_suboffsets()
1742 shape = PyMem_Malloc(base->ndim * (sizeof *shape)); in copy_structure()
1743 strides = PyMem_Malloc(base->ndim * (sizeof *strides)); in copy_structure()
[all …]
Datexitmodule.c31 atexit_callback *callback = PyMem_Malloc(sizeof(atexit_callback)); in PyUnstable_AtExit()
206 atexit_py_callback *callback = PyMem_Malloc(sizeof(atexit_py_callback)); in atexit_register()
D_randommodule.c344 key = (uint32_t *)PyMem_Malloc((size_t)4 * keyused); in random_seed()
526 wordarray = (uint32_t *)PyMem_Malloc(words * 4); in _random_Random_getrandbits_impl()
D_posixsubprocess.c218 array = PyMem_Malloc((argc + 1) * sizeof(char *)); in _PySequence_BytesToCharpArray()
238 array[i] = PyMem_Malloc(size); in _PySequence_BytesToCharpArray()
1196 c_fds_to_keep = PyMem_Malloc(fds_to_keep_len * sizeof(int)); in subprocess_fork_exec_impl()
D_zoneinfo.c1026 PyMem_Malloc(self->num_transitions * sizeof(int64_t)); in load_data()
1030 trans_idx = PyMem_Malloc(self->num_transitions * sizeof(Py_ssize_t)); in load_data()
1067 utcoff = PyMem_Malloc(self->num_ttinfos * sizeof(long)); in load_data()
1068 isdst = PyMem_Malloc(self->num_ttinfos * sizeof(unsigned char)); in load_data()
1114 self->_ttinfos = PyMem_Malloc(self->num_ttinfos * sizeof(_ttinfo)); in load_data()
2118 trans_local[i] = PyMem_Malloc(num_transitions * sizeof(int64_t)); in ts_to_local()
2323 StrongCacheNode *node = PyMem_Malloc(sizeof(StrongCacheNode)); in strong_cache_node_new()
Dgetpath.c264 wchar_t **parts = (wchar_t **)PyMem_Malloc(n * sizeof(wchar_t *)); in getpath_joinpath()
295 wchar_t *final = cchFinal > 0 ? (wchar_t *)PyMem_Malloc(cchFinal * sizeof(wchar_t)) : NULL; in getpath_joinpath()
364 char *buffer = (char *)PyMem_Malloc(MAX_FILE); in getpath_readlines()
D_lsprof.c212 self = (ProfilerEntry*) PyMem_Malloc(sizeof(ProfilerEntry)); in newProfilerEntry()
253 self = (ProfilerSubEntry*) PyMem_Malloc(sizeof(ProfilerSubEntry)); in newSubEntry()
381 PyMem_Malloc(sizeof(ProfilerContext)); in ptrace_enter_call()
D_scproxy.c39 buf = PyMem_Malloc(len*4); in cfstring_to_pystring()
Dpyexpat.c25 PyMem_Malloc, PyMem_Realloc, PyMem_Free};
1004 new_parser->buffer = PyMem_Malloc(new_parser->buffer_size); in pyexpat_xmlparser_ExternalEntityParserCreate_impl()
1373 self->buffer = PyMem_Malloc(self->buffer_size); in xmlparse_buffer_text_setter()
1437 self->buffer = PyMem_Malloc(new_buffer_size); in xmlparse_buffer_size_setter()
2036 struct PyExpat_CAPI *capi = PyMem_Malloc(sizeof(*capi)); in pyexpat_exec()
/external/python/cpython3/Parser/
Dpegen.c125 arr->items = PyMem_Malloc(initial_size * sizeof(*arr->items)); in growable_comment_array_init()
250 char *tag = PyMem_Malloc(len + 1); in _PyPegen_fill_token()
668 dup = PyMem_Malloc(strlen(s) + 1); in parsenumber()
800 Parser *p = PyMem_Malloc(sizeof(Parser)); in _PyPegen_Parser_New()
810 p->tokens = PyMem_Malloc(sizeof(Token *)); in _PyPegen_Parser_New()
/external/python/cpython3/Modules/_io/
Dwinconsoleio.c613 wchar_t *buf = (wchar_t*)PyMem_Malloc(maxlen * sizeof(wchar_t)); in read_console_w()
698 buf = (wchar_t *)PyMem_Malloc(sizeof(wchar_t)); in read_console_w()
879 buf = (wchar_t*)PyMem_Malloc((bufsize + 1) * sizeof(wchar_t)); in _io__WindowsConsoleIO_readall_impl()
1104 wbuf = (wchar_t*)PyMem_Malloc(wlen * sizeof(wchar_t));
/external/python/cpython3/Modules/_multiprocessing/
Dsemaphore.c504 name_copy = PyMem_Malloc(strlen(name) + 1); in _multiprocessing_SemLock_impl()
557 name_copy = PyMem_Malloc(strlen(name) + 1); in _multiprocessing_SemLock__rebuild_impl()
/external/python/cpython3/Objects/
Dcall.c491 stack = PyMem_Malloc((argcount + 1) * sizeof(PyObject *)); in _PyObject_Call_Prepend()
797 stack = PyMem_Malloc(nargs * sizeof(stack[0])); in object_vacall()
979 PyObject **stack = PyMem_Malloc((1 + nargs + nkwargs) * sizeof(args[0])); in _PyStack_UnpackDict()
Dcapsule.c234 char *name_dup = (char *)PyMem_Malloc(name_length); in PyCapsule_Import()
Dmemoryobject.c416 mem = PyMem_Malloc(dest->shape[0] * dest->itemsize); in copy_single()
448 mem = PyMem_Malloc(dest->shape[dest->ndim-1] * dest->itemsize); in copy_buffer()
506 strides = PyMem_Malloc(src->ndim * (sizeof *src->strides)); in buffer_to_contiguous()
864 char *cp = PyMem_Malloc(strlen(fmt)+1); in mbuf_copy_format()
1068 fb = PyMem_Malloc(sizeof *fb + 3 * src->ndim * (sizeof *fb->array)); in PyBuffer_ToContiguous()
2032 struct unpacker *x = PyMem_Malloc(sizeof *x); in unpacker_new()
2087 x->item = PyMem_Malloc(itemsize); in struct_get_unpacker()
3077 mem = PyMem_Malloc(view->len); in memory_hash()

1234