memgraph/include/utils/align.hpp

10 lines
211 B
C++
Raw Normal View History

2016-09-14 19:19:56 +08:00
#pragma once
// FROM: A Malloc Tutorial, Marwan Burelle, 2009
// align address x to 4 bytes
#define align_4(x) (((((x) - 1)>>2)<<2)+4)
// align address x to 8 bytes
#define align_8(x) (((((x) - 1)>>3)<<3)+8)