cpython/Modules/_testcapi/mem.c

#include "parts.h"

#include <stddef.h>


alloc_hook_t;

static void *
hook_malloc(void *ctx, size_t size)
{}

static void *
hook_calloc(void *ctx, size_t nelem, size_t elsize)
{}

static void *
hook_realloc(void *ctx, void *ptr, size_t new_size)
{}

static void
hook_free(void *ctx, void *ptr)
{}

/* Most part of the following code is inherited from the pyfailmalloc project
 * written by Victor Stinner. */
static struct {} FmHook;

static struct {} FmData;

static int
fm_nomemory(void)
{}

static void *
hook_fmalloc(void *ctx, size_t size)
{}

static void *
hook_fcalloc(void *ctx, size_t nelem, size_t elsize)
{}

static void *
hook_frealloc(void *ctx, void *ptr, size_t new_size)
{}

static void
hook_ffree(void *ctx, void *ptr)
{}

static void
fm_setup_hooks(void)
{}

static void
fm_remove_hooks(void)
{}

static PyObject *
set_nomemory(PyObject *self, PyObject *args)
{}

static PyObject *
remove_mem_hooks(PyObject *self, PyObject *Py_UNUSED(ignored))
{}

static PyObject *
test_setallocators(PyMemAllocatorDomain domain)
{}

static PyObject *
test_pyobject_setallocators(PyObject *self, PyObject *Py_UNUSED(ignored))
{}

static PyObject *
test_pyobject_new(PyObject *self, PyObject *Py_UNUSED(ignored))
{}

static PyObject *
test_pymem_alloc0(PyObject *self, PyObject *Py_UNUSED(ignored))
{}

static PyObject *
test_pymem_setrawallocators(PyObject *self, PyObject *Py_UNUSED(ignored))
{}

static PyObject *
test_pymem_setallocators(PyObject *self, PyObject *Py_UNUSED(ignored))
{}

static PyObject *
pyobject_malloc_without_gil(PyObject *self, PyObject *args)
{}

static PyObject *
pymem_buffer_overflow(PyObject *self, PyObject *args)
{}

static PyObject *
pymem_api_misuse(PyObject *self, PyObject *args)
{}

static PyObject *
pymem_malloc_without_gil(PyObject *self, PyObject *args)
{}


// Tracemalloc tests
static PyObject *
tracemalloc_track(PyObject *self, PyObject *args)
{}

static PyObject *
tracemalloc_untrack(PyObject *self, PyObject *args)
{}

static PyMethodDef test_methods[] =;

int
_PyTestCapi_Init_Mem(PyObject *mod)
{}