@@@ much mess, mostly manpages
[mLib] / utils / align.3.in
diff --git a/utils/align.3.in b/utils/align.3.in
new file mode 100644 (file)
index 0000000..b6e2a9c
--- /dev/null
@@ -0,0 +1,70 @@
+.\" -*-nroff-*-
+.\"
+.\" Manual for memory alignment
+.\"
+.\" (c) 2009, 2024 Straylight/Edgeware
+.\"
+.
+.\"----- Licensing notice ---------------------------------------------------
+.\"
+.\" This file is part of the mLib utilities library.
+.\"
+.\" mLib is free software: you can redistribute it and/or modify it under
+.\" the terms of the GNU Library General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or (at
+.\" your option) any later version.
+.\"
+.\" mLib is distributed in the hope that it will be useful, but WITHOUT
+.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
+.\" License for more details.
+.\"
+.\" You should have received a copy of the GNU Library General Public
+.\" License along with mLib.  If not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+.\" USA.
+.
+.\"--------------------------------------------------------------------------
+.so ../defs.man \" @@@PRE@@@
+.
+.\"--------------------------------------------------------------------------
+.TH align 3mLib "4 January 2009" "Straylight/Edgeware" "mLib utilities library"
+.\" @ALIGN
+.
+.\"--------------------------------------------------------------------------
+.SH NAME
+align \- alignment utilities
+.
+.\"--------------------------------------------------------------------------
+.SH SYNOPSIS
+.
+.nf
+.B "#include <mLib/align.h>"
+.PP
+.BI "size_t ALIGN(size_t " sz ");"
+.fi
+.
+.\"--------------------------------------------------------------------------
+.SH DESCRIPTION
+The
+.B ALIGN
+macro returns the value of its argument
+.I sz
+rounded up to the next multiple of the size of
+.BR "union align" ,
+which is defined as a union containing a selection of built-in types.
+The intent is to write fairly portable memory allocators, which must
+return correctly-aligned memory.
+.IR array .
+.
+.\"--------------------------------------------------------------------------
+.SH "SEE ALSO"
+.
+.BR mLib (3).
+.
+.\"--------------------------------------------------------------------------
+.SH "AUTHOR"
+.
+Mark Wooding, <mdw@distorted.org.uk>
+.
+.\"----- That's all, folks --------------------------------------------------