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

Rusty Russell rusty at rustcorp.com.au
Wed Sep 9 04:38:38 AEST 2015


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?

Cheers,
Rusty.


More information about the ccan mailing list