Move memory-alignment static utility from engine_macro.h to engine_io.c

PiperOrigin-RevId: 517259347
Change-Id: Ic3f67e9018fe8903e709128674c0da10032e2162
This commit is contained in:
Yuval Tassa
2023-03-16 16:26:46 -07:00
committed by Copybara-Service
parent 7690965d73
commit 47b58f5ccb
2 changed files with 9 additions and 7 deletions
+9
View File
@@ -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
-7
View File
@@ -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_