[ccan] [PATCH 2/2] mem: Add memswap() function

David Gibson david at gibson.dropbear.id.au
Wed Sep 9 17:37:59 AEST 2015


On Wed, Sep 09, 2015 at 04:08:38AM +0930, Paul 'Rusty' Russell wrote:
> David Gibson <david at gibson.dropbear.id.au> writes:
> > Add a memswap() function to the mem module, which exchanges two (equal
> > sized, non-overlapping) memory regions.
> 
> Nice!
> 
> I wonder about a #if CCAN_MEM_DEBUG'd test which assert() tests for
> no overlap.
> 
> Though maybe it's cheap enough that a simple assert() is always OK?

Good idea.  And actually.. an exposed function to tell if memory
ranges overlap might be nice too, why not.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20150909/6934beb0/attachment.sig>


More information about the ccan mailing list