svn commit: samba r6033 - in branches/SAMBA_4_0/source/lib/talloc: .
abartlet at samba.org
abartlet at samba.org
Thu Mar 24 08:00:20 GMT 2005
Author: abartlet
Date: 2005-03-24 08:00:15 +0000 (Thu, 24 Mar 2005)
New Revision: 6033
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6033
Log:
Patch from 'lifeless' to clarify behaviour with NULL pointers.
Andrew Bartlett
Modified:
branches/SAMBA_4_0/source/lib/talloc/talloc.c
branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt
Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2005-03-24 06:30:38 UTC (rev 6032)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2005-03-24 08:00:15 UTC (rev 6033)
@@ -609,7 +609,8 @@
/*
move a lump of memory from one talloc context to another return the
- ptr on success, or NULL if it could not be transferred
+ ptr on success, or NULL if it could not be transferred.
+ passing NULL as ptr will always return NULL with no side effects.
*/
void *talloc_steal(const void *new_ctx, const void *ptr)
{
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt 2005-03-24 06:30:38 UTC (rev 6032)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt 2005-03-24 08:00:15 UTC (rev 6033)
@@ -306,6 +306,7 @@
if you are not careful with talloc_steal(). No guarantees are provided
as to your sanity or the safety of your data if you do this.
+talloc_steal (new_ctx, NULL) will return NULL with no sideeffects.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
off_t talloc_total_size(const void *ptr);
More information about the samba-cvs
mailing list