diff options
Diffstat (limited to 'src/lib/libc/stdlib/malloc.3')
-rw-r--r-- | src/lib/libc/stdlib/malloc.3 | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3 index c1776f61cb..c0472ee2b9 100644 --- a/src/lib/libc/stdlib/malloc.3 +++ b/src/lib/libc/stdlib/malloc.3 | |||
@@ -30,9 +30,9 @@ | |||
30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
31 | .\" SUCH DAMAGE. | 31 | .\" SUCH DAMAGE. |
32 | .\" | 32 | .\" |
33 | .\" $OpenBSD: malloc.3,v 1.119 2018/11/18 16:15:18 otto Exp $ | 33 | .\" $OpenBSD: malloc.3,v 1.120 2018/11/21 06:57:04 otto Exp $ |
34 | .\" | 34 | .\" |
35 | .Dd $Mdocdate: November 18 2018 $ | 35 | .Dd $Mdocdate: November 21 2018 $ |
36 | .Dt MALLOC 3 | 36 | .Dt MALLOC 3 |
37 | .Os | 37 | .Os |
38 | .Sh NAME | 38 | .Sh NAME |
@@ -43,8 +43,7 @@ | |||
43 | .Nm reallocarray , | 43 | .Nm reallocarray , |
44 | .Nm recallocarray , | 44 | .Nm recallocarray , |
45 | .Nm freezero , | 45 | .Nm freezero , |
46 | .Nm aligned_alloc , | 46 | .Nm aligned_alloc |
47 | .Nm malloc_usable_size | ||
48 | .Nd memory allocation and deallocation | 47 | .Nd memory allocation and deallocation |
49 | .Sh SYNOPSIS | 48 | .Sh SYNOPSIS |
50 | .In stdlib.h | 49 | .In stdlib.h |
@@ -65,7 +64,6 @@ | |||
65 | .Ft void * | 64 | .Ft void * |
66 | .Fn aligned_alloc "size_t alignment" "size_t size" | 65 | .Fn aligned_alloc "size_t alignment" "size_t size" |
67 | .Ft size_t | 66 | .Ft size_t |
68 | .Fn malloc_usable_size "void *ptr" | ||
69 | .Vt char *malloc_options ; | 67 | .Vt char *malloc_options ; |
70 | .Sh DESCRIPTION | 68 | .Sh DESCRIPTION |
71 | The standard functions | 69 | The standard functions |
@@ -236,25 +234,6 @@ If | |||
236 | is not a multiple of | 234 | is not a multiple of |
237 | .Fa alignment , | 235 | .Fa alignment , |
238 | behavior is undefined. | 236 | behavior is undefined. |
239 | .Pp | ||
240 | The | ||
241 | .Fn malloc_usable_size | ||
242 | function returns the actual size of the allocated memory pointed to by | ||
243 | .Va ptr . | ||
244 | If | ||
245 | .Va ptr | ||
246 | is | ||
247 | .Dv NULL , | ||
248 | it returns 0. | ||
249 | If | ||
250 | .Va ptr | ||
251 | was never returned by an allocation function or freed before, | ||
252 | the behavior is undefined. | ||
253 | This function should not be relied upon since it exposes some of the internal | ||
254 | workings of the | ||
255 | .Fn malloc | ||
256 | family of functions. | ||
257 | Writing beyond the requested size introduces undefined behavior. | ||
258 | .Sh RETURN VALUES | 237 | .Sh RETURN VALUES |
259 | Upon successful completion, the allocation functions | 238 | Upon successful completion, the allocation functions |
260 | return a pointer to the allocated space; otherwise, | 239 | return a pointer to the allocated space; otherwise, |
@@ -640,9 +619,7 @@ function appeared in | |||
640 | .Ox 6.2 . | 619 | .Ox 6.2 . |
641 | The | 620 | The |
642 | .Fn aligned_alloc | 621 | .Fn aligned_alloc |
643 | and | 622 | function appeared in |
644 | .Fn malloc_usable_size | ||
645 | functions appeared in | ||
646 | .Ox 6.5 . | 623 | .Ox 6.5 . |
647 | .Sh CAVEATS | 624 | .Sh CAVEATS |
648 | When using | 625 | When using |