<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2657.73">
<TITLE>RE: [Pyrex] Just some thoughts</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>&gt; 2) I think that Pyrex should offer some low-level memory managment routines. </FONT>
<BR><FONT SIZE=2>&gt; I think of sizeof operator, as well as the C standard *alloc and free </FONT>
<BR><FONT SIZE=2>&gt; functions. It would be also nice to have something like the g_new macro </FONT>
<BR><FONT SIZE=2>&gt; known from the GLib library.</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; [snip]</FONT>
</P>

<P><FONT SIZE=2>If you read the Pyrex doco you will find that it is preferred to use the python</FONT>
<BR><FONT SIZE=2>memory management routines when allocating memory:</FONT>
</P>

<P><FONT SIZE=2>ctypedef long size_t</FONT>
</P>

<P><FONT SIZE=2>cdef extern from &quot;Python.h&quot;:</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; void* PyMem_Malloc(size_t n)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; void PyMem_Free(void* mem)</FONT>
</P>

<P><FONT SIZE=2>They also have new and delete analogues if that is preferred. The doco for these</FONT>
<BR><FONT SIZE=2>functions is in the Python documentation in the Python/C API section.</FONT>
</P>

</BODY>
<!--[object_id=#infocomp.com#]--><P><FONT face=Arial color=#808080 size=1>Important notice: This message is intended for the individual(s) and entity(s) addressed. The information contained in this transmission and any attached, may be confidential and may also be the subject of legal privilege, public interest immunity or legal professional privilege. Any review, retransmission, dissemination or other use of, taking of any action in reliance upon this information by person or entities other than the recipient is prohibited and requires authorization from the sender. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person) you may not copy or deliver this message to anyone. In such cases you should destroy this message and kindly notify the sender by reply email. </FONT></P>
<P><FONT face=Arial color=#808080 size=1>WARNING: Although Infocomp has taken reasonable precautions so that no viruses&nbsp;are present in this e-mail, the company cannot accept responsibility for any loss or damage arising from the use of e-mail attachments.</FONT></P></HTML>