summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemallh.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemallh.h')
-rw-r--r--Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemallh.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemallh.h b/Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemallh.h
index de448ecd51f..a543d1acb06 100644
--- a/Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemallh.h
+++ b/Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemallh.h
@@ -12,6 +12,16 @@ typedef struct ghost16 ghost16;
typedef struct ghost32 ghost32;
typedef struct ghost64 ghost64;
+#define aligned_size8(size) (size)
+#define aligned_size16(size) ((((size) + 1) >> 1) << 1)
+#define aligned_size32(size) ((((size) + 3) >> 2) << 2)
+#define aligned_size64(size) ((((size) + 7) >> 3) << 3)
+
+#define aligned_space8(size) (size)
+#define aligned_space16(size) (((size) & 1) ? ((size) < 0xFFFF ? ((size) + 1) : ((size) - 1)) : (size))
+#define aligned_space32(size) (((size) & 3) ? ((size) < 0xFFFFFFFD ? ((size) - ((size) & 3) + 4) : (size) - ((size) & 3)) : (size))
+#define aligned_space64(size) (((size) & 7) ? ((size) < 0xFFFFFFFFFFFFFFF8ULL ? ((size) - ((size) & 7) + 8) : (size) - ((size) & 7)) : (size))
+
/* info stub */
typedef struct {