add code to add free shadow memory to heap (currently disabled)
Check whether double buffering ('bounce buffering') is needed and only do
it if needed.