malloc.9 (bd555da94b1517d6441660317193ff901bb5387b) malloc.9 (93f31533dfb3edff8b0d0ee96a8e4d28cd2b79fc)
1.\"
2.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
3.\" All rights reserved.
4.\"
5.\" This code is derived from software contributed to The NetBSD Foundation
6.\" by Paul Kranenburg.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 32 unchanged lines hidden (view full) ---

41.Nm MALLOC_DECLARE
42.Nd kernel memory management routines
43.Sh SYNOPSIS
44.In sys/types.h
45.In sys/malloc.h
46.Ft void *
47.Fn malloc "size_t size" "struct malloc_type *type" "int flags"
48.Ft void *
1.\"
2.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
3.\" All rights reserved.
4.\"
5.\" This code is derived from software contributed to The NetBSD Foundation
6.\" by Paul Kranenburg.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 32 unchanged lines hidden (view full) ---

41.Nm MALLOC_DECLARE
42.Nd kernel memory management routines
43.Sh SYNOPSIS
44.In sys/types.h
45.In sys/malloc.h
46.Ft void *
47.Fn malloc "size_t size" "struct malloc_type *type" "int flags"
48.Ft void *
49.Fn malloc_domain "size_t size" "struct malloc_type *type" "int domain" "int flags"
50.Ft void *
49.Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" "int flags"
50.Ft void
51.Fn free "void *addr" "struct malloc_type *type"
51.Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" "int flags"
52.Ft void
53.Fn free "void *addr" "struct malloc_type *type"
54.Ft void
55.Fn free_domain "void *addr" "struct malloc_type *type"
52.Ft void *
53.Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags"
54.Ft void *
55.Fn reallocf "void *addr" "size_t size" "struct malloc_type *type" "int flags"
56.Fn MALLOC_DECLARE type
57.In sys/param.h
58.In sys/malloc.h
59.In sys/kernel.h
60.Fn MALLOC_DEFINE type shortdesc longdesc
61.Sh DESCRIPTION
62The
63.Fn malloc
64function allocates uninitialized memory in kernel address space for an
65object whose size is specified by
66.Fa size .
67.Pp
68The
56.Ft void *
57.Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags"
58.Ft void *
59.Fn reallocf "void *addr" "size_t size" "struct malloc_type *type" "int flags"
60.Fn MALLOC_DECLARE type
61.In sys/param.h
62.In sys/malloc.h
63.In sys/kernel.h
64.Fn MALLOC_DEFINE type shortdesc longdesc
65.Sh DESCRIPTION
66The
67.Fn malloc
68function allocates uninitialized memory in kernel address space for an
69object whose size is specified by
70.Fa size .
71.Pp
72The
73.Fn malloc_domain
74variant allocates the object from the specified memory domain. Memory allocated
75with this function should be returned with
76.Fn free_domain .
77See
78.Xr numa 9 for more details.
79.Pp
80The
69.Fn mallocarray
70function allocates uninitialized memory in kernel address space for an
71array of
72.Fa nmemb
73entries whose size is specified by
74.Fa size .
75.Pp
76The

--- 223 unchanged lines hidden ---
81.Fn mallocarray
82function allocates uninitialized memory in kernel address space for an
83array of
84.Fa nmemb
85entries whose size is specified by
86.Fa size .
87.Pp
88The

--- 223 unchanged lines hidden ---