fredbasset1...@gmail.com writes:

> I've written a C extension, see code below, to provide a Python
> interface to a hardware watchdog timer.  As part of the initialization
> it makes some calls to mmap, I am wondering should I be making
> balanced calls to munmap in some kind of de-init function?

The kernel should remove the mapping when your process exits anyway --
otherwise the world would be left in an inconsistent state if your
process got killed by SIGKILL for example.

> Do Python extensions have d'tors?

No.  But you can cheat: stash some object whose tp_del slot does your
cleanup in your extension's module under some funny name.  (And woe
betide anyone who dels the funny name prematurely!)  I'm not sure I'd
bother.

-- [mdw]
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to