chiark / gitweb /
@@@ much mess, mostly manpages
[mLib] / utils / align.3.in
1 .\" -*-nroff-*-
2 .\"
3 .\" Manual for memory alignment
4 .\"
5 .\" (c) 2009, 2024 Straylight/Edgeware
6 .\"
7 .
8 .\"----- Licensing notice ---------------------------------------------------
9 .\"
10 .\" This file is part of the mLib utilities library.
11 .\"
12 .\" mLib is free software: you can redistribute it and/or modify it under
13 .\" the terms of the GNU Library General Public License as published by
14 .\" the Free Software Foundation; either version 2 of the License, or (at
15 .\" your option) any later version.
16 .\"
17 .\" mLib is distributed in the hope that it will be useful, but WITHOUT
18 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
20 .\" License for more details.
21 .\"
22 .\" You should have received a copy of the GNU Library General Public
23 .\" License along with mLib.  If not, write to the Free Software
24 .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25 .\" USA.
26 .
27 .\"--------------------------------------------------------------------------
28 .so ../defs.man \" @@@PRE@@@
29 .
30 .\"--------------------------------------------------------------------------
31 .TH align 3mLib "4 January 2009" "Straylight/Edgeware" "mLib utilities library"
32 .\" @ALIGN
33 .
34 .\"--------------------------------------------------------------------------
35 .SH NAME
36 align \- alignment utilities
37 .
38 .\"--------------------------------------------------------------------------
39 .SH SYNOPSIS
40 .
41 .nf
42 .B "#include <mLib/align.h>"
43 .PP
44 .BI "size_t ALIGN(size_t " sz ");"
45 .fi
46 .
47 .\"--------------------------------------------------------------------------
48 .SH DESCRIPTION
49 The
50 .B ALIGN
51 macro returns the value of its argument
52 .I sz
53 rounded up to the next multiple of the size of
54 .BR "union align" ,
55 which is defined as a union containing a selection of built-in types.
56 The intent is to write fairly portable memory allocators, which must
57 return correctly-aligned memory.
58 .IR array .
59 .
60 .\"--------------------------------------------------------------------------
61 .SH "SEE ALSO"
62 .
63 .BR mLib (3).
64 .
65 .\"--------------------------------------------------------------------------
66 .SH "AUTHOR"
67 .
68 Mark Wooding, <mdw@distorted.org.uk>
69 .
70 .\"----- That's all, folks --------------------------------------------------