Another question about extending Python

Martin v. Löwis martin at v.loewis.de
Fri Dec 13 10:43:49 EST 2002


> If I extend Python with C++ as described in the Manual
> "Extending and Embedding Python": May I allocate memory in
> my C++ program using new (and free it with delete)?

Certainly. You just can't use new if you pass the memory to the Python
runtime, and the Python runtime frees it (there are very few places
where the runtime frees memory that you have allocated).

Regards,
Martin




More information about the Python-list mailing list