how is memory managed in python
Answers
Answered by
3
The allocation of heap space forPython objects and other internal buffers is performed on demand by thePython memory manager through thePython/C API functions listed in this document.
EX -
PyObject *res; char *buf = (char *) malloc(BUFSIZ); /* for I/O */ if (buf == NULL) return PyErr_NoMemory(); ...Do some I/O operation involving buf... res = PyString_FromString(buf); free(buf); /* malloc'ed */ return res;
NICE QUESTION__HOPE HELP YOU__THANKS✌️✌️
Similar questions