Lines Matching defs:alloc
591 PyMemAllocatorEx *alloc = (PyMemAllocatorEx *)ctx;
597 ptr = alloc->calloc(alloc->ctx, nelem, elsize);
599 ptr = alloc->malloc(alloc->ctx, nelem * elsize);
607 alloc->free(alloc->ctx, ptr);
618 PyMemAllocatorEx *alloc = (PyMemAllocatorEx *)ctx;
621 ptr2 = alloc->realloc(alloc->ctx, ptr, new_size);
657 alloc->free(alloc->ctx, ptr2);
669 PyMemAllocatorEx *alloc = (PyMemAllocatorEx *)ctx;
677 alloc->free(alloc->ctx, ptr);
691 PyMemAllocatorEx *alloc = (PyMemAllocatorEx *)ctx;
693 return alloc->calloc(alloc->ctx, nelem, elsize);
695 return alloc->malloc(alloc->ctx, nelem * elsize);
734 PyMemAllocatorEx *alloc = (PyMemAllocatorEx *)ctx;
736 ptr2 = alloc->realloc(alloc->ctx, ptr, new_size);
765 PyMemAllocatorEx *alloc = (PyMemAllocatorEx *)ctx;
767 return alloc->calloc(alloc->ctx, nelem, elsize);
769 return alloc->malloc(alloc->ctx, nelem * elsize);
808 PyMemAllocatorEx *alloc = (PyMemAllocatorEx *)ctx;
810 ptr2 = alloc->realloc(alloc->ctx, ptr, new_size);
958 PyMemAllocatorEx alloc;
989 alloc.malloc = tracemalloc_raw_malloc;
990 alloc.calloc = tracemalloc_raw_calloc;
991 alloc.realloc = tracemalloc_raw_realloc;
992 alloc.free = tracemalloc_free;
994 alloc.ctx = &allocators.raw;
996 PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc);
999 alloc.malloc = tracemalloc_malloc_gil;
1000 alloc.calloc = tracemalloc_calloc_gil;
1001 alloc.realloc = tracemalloc_realloc_gil;
1002 alloc.free = tracemalloc_free;
1004 alloc.ctx = &allocators.mem;
1006 PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &alloc);
1008 alloc.ctx = &allocators.obj;
1010 PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &alloc);