write ahead log

ロールフォワード用

chibiccを読んだときに出てくるアライメント調整用関数のアルゴリズムの名前が知りたい

rui氏作のCコンパイラであるchibiccを読むとアライメント調整用の関数がある。

GitHub - rui314/chibicc: A small C compiler

// Round up `n` to the nearest multiple of `align`. For instance,
// align_to(5, 8) returns 8 and align_to(11, 8) returns 16.
static int align_to(int n, int align) {
  return (n + align - 1) / align * align;
}

何か名前ついてそうだけどそんなことないのかしら。