[Pyrex] Total newbie needs code review

Grant McDonald gmcdonald at infocomp.com
Mon Sep 12 03:10:47 CEST 2005


> Should'nt this be:
>
> copy = <char *>PyMem_Malloc( (len(pyString) + 1) * sizeof(char) )
>
Yes. That's what i meant :)

> According to K&R v2 p204, sizeof(char) == 1; pretend you are an 
> optimising compiler and see what you get.

A good reason to always be explicit in what you want. Assumptions always
cause problems at some point!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.copyleft.no/pipermail/pyrex/attachments/20050912/4698d010/attachment.html


More information about the Pyrex mailing list