Lines Matching refs:nbytes
1597 size_t nbytes;
1609 nbytes = numarenas * sizeof(*arenas);
1610 arenaobj = (struct arena_object *)PyMem_RawRealloc(arenas, nbytes);
1948 pymalloc_alloc(void *ctx, size_t nbytes)
1959 if (UNLIKELY(nbytes == 0)) {
1962 if (UNLIKELY(nbytes > SMALL_REQUEST_THRESHOLD)) {
1966 uint size = (uint)(nbytes - 1) >> ALIGNMENT_SHIFT;
1996 _PyObject_Malloc(void *ctx, size_t nbytes)
1998 void* ptr = pymalloc_alloc(ctx, nbytes);
2003 ptr = PyMem_RawMalloc(nbytes);
2015 size_t nbytes = nelem * elsize;
2017 void* ptr = pymalloc_alloc(ctx, nbytes);
2019 memset(ptr, 0, nbytes);
2293 If nbytes==0, then as the Python docs promise, we do not treat this like
2301 pymalloc_realloc(void *ctx, void **newptr_p, void *p, size_t nbytes)
2320 If nbytes <= SMALL_REQUEST_THRESHOLD, it's tempting to try to take
2328 memory fault can occur if we try to copy nbytes bytes starting at p.
2335 if (nbytes <= size) {
2343 if (4 * nbytes > 3 * size) {
2348 size = nbytes;
2351 bp = _PyObject_Malloc(ctx, nbytes);
2362 _PyObject_Realloc(void *ctx, void *ptr, size_t nbytes)
2367 return _PyObject_Malloc(ctx, nbytes);
2370 if (pymalloc_realloc(ctx, &ptr2, ptr, nbytes)) {
2374 return PyMem_RawRealloc(ptr, nbytes);
2479 _PyMem_DebugRawAlloc(int use_calloc, void *ctx, size_t nbytes)
2484 uint8_t *tail; /* data + nbytes == pointer to tail pad bytes */
2485 size_t total; /* nbytes + PYMEM_DEBUG_EXTRA_BYTES */
2487 if (nbytes > (size_t)PY_SSIZE_T_MAX - PYMEM_DEBUG_EXTRA_BYTES) {
2491 total = nbytes + PYMEM_DEBUG_EXTRA_BYTES;
2495 S: nbytes stored as size_t
2520 write_size_t(p, nbytes);
2524 if (nbytes > 0 && !use_calloc) {
2525 memset(data, PYMEM_CLEANBYTE, nbytes);
2529 tail = data + nbytes;
2539 _PyMem_DebugRawMalloc(void *ctx, size_t nbytes)
2541 return _PyMem_DebugRawAlloc(0, ctx, nbytes);
2547 size_t nbytes;
2549 nbytes = nelem * elsize;
2550 return _PyMem_DebugRawAlloc(1, ctx, nbytes);
2569 size_t nbytes;
2572 nbytes = read_size_t(q);
2573 nbytes += PYMEM_DEBUG_EXTRA_BYTES;
2574 memset(q, PYMEM_DEADBYTE, nbytes);
2580 _PyMem_DebugRawRealloc(void *ctx, void *p, size_t nbytes)
2583 return _PyMem_DebugRawAlloc(0, ctx, nbytes);
2590 uint8_t *tail; /* data + nbytes == pointer to tail pad bytes */
2591 size_t total; /* 2 * SST + nbytes + 2 * SST */
2601 if (nbytes > (size_t)PY_SSIZE_T_MAX - PYMEM_DEBUG_EXTRA_BYTES) {
2605 total = nbytes + PYMEM_DEBUG_EXTRA_BYTES;
2632 nbytes = original_nbytes;
2643 write_size_t(head, nbytes);
2647 tail = data + nbytes;
2655 memcpy(data, save, Py_MIN(nbytes, original_nbytes));
2659 memcpy(data, save, Py_MIN(nbytes, ERASED_SIZE));
2660 if (nbytes > i) {
2662 Py_MIN(nbytes - i, ERASED_SIZE));
2670 if (nbytes > original_nbytes) {
2673 nbytes - original_nbytes);
2690 _PyMem_DebugMalloc(void *ctx, size_t nbytes)
2693 return _PyMem_DebugRawMalloc(ctx, nbytes);
2713 _PyMem_DebugRealloc(void *ctx, void *ptr, size_t nbytes)
2716 return _PyMem_DebugRawRealloc(ctx, ptr, nbytes);
2730 size_t nbytes;
2756 nbytes = read_size_t(q - 2*SST);
2757 tail = q + nbytes;
2772 size_t nbytes;
2785 nbytes = read_size_t(q - 2*SST);
2786 fprintf(stderr, " %zu bytes originally requested\n", nbytes);
2816 tail = q + nbytes;
2847 if (nbytes > 0) {