Move memory-alignment static utility from engine_macro.h to engine_io.c
PiperOrigin-RevId: 517259347 Change-Id: Ic3f67e9018fe8903e709128674c0da10032e2162
This commit is contained in:
committed by
Copybara-Service
parent
7690965d73
commit
47b58f5ccb
@@ -308,6 +308,15 @@ static void bufread(void* dest, int num, int szbuf, const void* buf, int* ptrbuf
|
||||
|
||||
|
||||
|
||||
// number of bytes to be skipped to achieve 64-byte alignment
|
||||
static inline unsigned int SKIP(intptr_t offset) {
|
||||
const unsigned int align = 64;
|
||||
// compute skipped bytes
|
||||
return (align - (offset % align)) % align;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------- mjModel construction -----------------------------------------
|
||||
|
||||
// set pointers in mjModel buffer
|
||||
|
||||
@@ -73,11 +73,4 @@
|
||||
|
||||
#define PTRDIFF(x, y) ((char*)(x) - (char*)(y))
|
||||
|
||||
// number of bytes to be skipped to achieve 64-byte alignment
|
||||
static inline unsigned int SKIP(intptr_t offset) {
|
||||
const unsigned int align = 64;
|
||||
// compute skipped bytes
|
||||
return (align - (offset % align)) % align;
|
||||
}
|
||||
|
||||
#endif // MUJOCO_SRC_ENGINE_ENGINE_MACRO_H_
|
||||
|
||||
Reference in New Issue
Block a user