[Python-Dev] Proper initialization of structs

Christian Heimes lists at cheimes.de
Fri Oct 31 14:01:55 CET 2008


Alexandre Vassalotti wrote:
> But what if  PyType_GenericAlloc is used for tp_alloc? As far as I
> know, the memory block allocated with PyType_GenericAlloc is zeroed.

Oh, you are right. The generic allocator uses memset to initialize the
block with \0.

Christian



More information about the Python-Dev mailing list