摘要:
什么是 “ 达夫设备” (Duff's Device)? 这是个很棒的迂回循环展开法, 由Tom Duff在Lucasfilm时所设计。它的 “传统” 形态, 是用来复制多个字节: register n = (count + 7) / 8; /* count > 0 assumed */ switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++;... 阅读全文