[Python-checkins] CVS: python/dist/src/Doc/api memory.tex,1.1,1.2
Tim Peters
tim_one@users.sourceforge.net
Sat, 06 Apr 2002 01:14:35 -0800
- Previous message: [Python-checkins] CVS: python/dist/src/Include boolobject.h,1.1,1.2
- Next message: [Python-checkins] CVS: python/dist/src acconfig.h,1.59,1.60 configure,1.293,1.294 configure.in,1.303,1.304 pyconfig.h.in,1.25,1.26
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Doc/api
In directory usw-pr-cvs1:/tmp/cvs-serv30945/python/Doc/api
Modified Files:
memory.tex
Log Message:
Minor clarification about what's actually promised for PyMem_Malloc(0).
I probably didn't do a correct thing for the LaTeX spelling of the
integer 1.
Index: memory.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/memory.tex,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** memory.tex 12 Oct 2001 19:01:43 -0000 1.1
--- memory.tex 6 Apr 2002 09:14:33 -0000 1.2
***************
*** 27,31 ****
It is important to understand that the management of the Python heap
is performed by the interpreter itself and that the user has no
! control on it, even if she regularly manipulates object pointers to
memory blocks inside that heap. The allocation of heap space for
Python objects and other internal buffers is performed on demand by
--- 27,31 ----
It is important to understand that the management of the Python heap
is performed by the interpreter itself and that the user has no
! control over it, even if she regularly manipulates object pointers to
memory blocks inside that heap. The allocation of heap space for
Python objects and other internal buffers is performed on demand by
***************
*** 80,85 ****
\section{Memory Interface \label{memoryInterface}}
! The following function sets, modeled after the ANSI C standard, are
! available for allocating and releasing memory from the Python heap:
--- 80,86 ----
\section{Memory Interface \label{memoryInterface}}
! The following function sets, modeled after the ANSI C standard,
! but specifying behavior when requesting zero bytes,
! are available for allocating and releasing memory from the Python heap:
***************
*** 87,91 ****
Allocates \var{n} bytes and returns a pointer of type \ctype{void*}
to the allocated memory, or \NULL{} if the request fails.
! Requesting zero bytes returns a non-\NULL{} pointer.
The memory will not have been initialized in any way.
\end{cfuncdesc}
--- 88,93 ----
Allocates \var{n} bytes and returns a pointer of type \ctype{void*}
to the allocated memory, or \NULL{} if the request fails.
! Requesting zero bytes returns a distinct non-\NULL{} pointer if
! possible, as if \cfunction{PyMem_Malloc(1)} had been called instead.
The memory will not have been initialized in any way.
\end{cfuncdesc}
***************
*** 95,99 ****
The contents will be unchanged to the minimum of the old and the new
sizes. If \var{p} is \NULL, the call is equivalent to
! \cfunction{PyMem_Malloc(\var{n})}; if \var{n} is equal to zero, the
memory block is resized but is not freed, and the returned pointer
is non-\NULL. Unless \var{p} is \NULL, it must have been
--- 97,101 ----
The contents will be unchanged to the minimum of the old and the new
sizes. If \var{p} is \NULL, the call is equivalent to
! \cfunction{PyMem_Malloc(\var{n})}; else if \var{n} is equal to zero, the
memory block is resized but is not freed, and the returned pointer
is non-\NULL. Unless \var{p} is \NULL, it must have been
***************
*** 107,111 ****
\cfunction{PyMem_Realloc()}. Otherwise, or if
\cfunction{PyMem_Free(p)} has been called before, undefined
! behaviour occurs. If \var{p} is \NULL, no operation is performed.
\end{cfuncdesc}
--- 109,113 ----
\cfunction{PyMem_Realloc()}. Otherwise, or if
\cfunction{PyMem_Free(p)} has been called before, undefined
! behavior occurs. If \var{p} is \NULL, no operation is performed.
\end{cfuncdesc}
- Previous message: [Python-checkins] CVS: python/dist/src/Include boolobject.h,1.1,1.2
- Next message: [Python-checkins] CVS: python/dist/src acconfig.h,1.59,1.60 configure,1.293,1.294 configure.in,1.303,1.304 pyconfig.h.in,1.25,1.26
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]