Computer Science, asked by arindom21, 1 year ago

how is memory managed in python

Answers

Answered by choudhary21
3
\color{Black}{ \boxed{\bold{\underline{HELLO... DEAR}}}}


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;

<b><marquee> NICE QUESTION__HOPE HELP YOU__THANKS✌️✌️
Similar questions