]> git.saurik.com Git - apple/libc.git/blame_incremental - gen/malloc_size.3
Libc-763.11.tar.gz
[apple/libc.git] / gen / malloc_size.3
... / ...
CommitLineData
1.\" Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
2.\"
3.\" @APPLE_LICENSE_HEADER_START@
4.\"
5.\" The contents of this file constitute Original Code as defined in and
6.\" are subject to the Apple Public Source License Version 1.1 (the
7.\" "License"). You may not use this file except in compliance with the
8.\" License. Please obtain a copy of the License at
9.\" http://www.apple.com/publicsource and read it before using this file.
10.\"
11.\" This Original Code and all software distributed under the License are
12.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
13.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
14.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
15.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
16.\" License for the specific language governing rights and limitations
17.\" under the License.
18.\"
19.\" @APPLE_LICENSE_HEADER_END@
20.\"
21.Dd May 23, 2006
22.Dt MALLOC_SIZE 3
23.Os
24.Sh NAME
25.Nm malloc_good_size ,
26.Nm malloc_size
27.Nd memory allocation information
28.Sh SYNOPSIS
29.In malloc/malloc.h
30.Ft size_t
31.Fo malloc_good_size
32.Fa "size_t size"
33.Fc
34.Ft size_t
35.Fo malloc_size
36.Fa "const void *ptr"
37.Fc
38.Sh DESCRIPTION
39The
40.Fn malloc_size
41function returns the size of the memory block
42that backs the allocation pointed to by
43.Fa ptr .
44The memory block size is always at least as large
45as the allocation it backs, and may be larger.
46.Pp
47The
48.Fn malloc_good_size
49function rounds
50.Fa size
51up to a value that the allocator implementation can allocate
52without adding any padding;
53it then returns that rounded-up value.
54.Sh SEE ALSO
55.Xr malloc 3