malloc(9): Change nominal size to size_t to match standard C
No functional change -- size_t matches unsigned long on all platforms. Reported by: bde Discussed with: jhb Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
b12a7532e3
commit
bd555da94b
@ -29,7 +29,7 @@
|
||||
.\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd January 10, 2018
|
||||
.Dd January 24, 2018
|
||||
.Dt MALLOC 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -44,15 +44,15 @@
|
||||
.In sys/types.h
|
||||
.In sys/malloc.h
|
||||
.Ft void *
|
||||
.Fn malloc "unsigned long size" "struct malloc_type *type" "int flags"
|
||||
.Fn malloc "size_t size" "struct malloc_type *type" "int flags"
|
||||
.Ft void *
|
||||
.Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" "int flags"
|
||||
.Ft void
|
||||
.Fn free "void *addr" "struct malloc_type *type"
|
||||
.Ft void *
|
||||
.Fn realloc "void *addr" "unsigned long size" "struct malloc_type *type" "int flags"
|
||||
.Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags"
|
||||
.Ft void *
|
||||
.Fn reallocf "void *addr" "unsigned long size" "struct malloc_type *type" "int flags"
|
||||
.Fn reallocf "void *addr" "size_t size" "struct malloc_type *type" "int flags"
|
||||
.Fn MALLOC_DECLARE type
|
||||
.In sys/param.h
|
||||
.In sys/malloc.h
|
||||
|
@ -518,7 +518,7 @@ malloc_dbg(caddr_t *vap, unsigned long *sizep, struct malloc_type *mtp,
|
||||
* the allocation fails.
|
||||
*/
|
||||
void *
|
||||
malloc(unsigned long size, struct malloc_type *mtp, int flags)
|
||||
malloc(size_t size, struct malloc_type *mtp, int flags)
|
||||
{
|
||||
int indx;
|
||||
struct malloc_type_internal *mtip;
|
||||
@ -567,7 +567,7 @@ malloc(unsigned long size, struct malloc_type *mtp, int flags)
|
||||
}
|
||||
|
||||
void *
|
||||
malloc_domain(unsigned long size, struct malloc_type *mtp, int domain,
|
||||
malloc_domain(size_t size, struct malloc_type *mtp, int domain,
|
||||
int flags)
|
||||
{
|
||||
int indx;
|
||||
@ -754,7 +754,7 @@ free_domain(void *addr, struct malloc_type *mtp)
|
||||
* realloc: change the size of a memory block
|
||||
*/
|
||||
void *
|
||||
realloc(void *addr, unsigned long size, struct malloc_type *mtp, int flags)
|
||||
realloc(void *addr, size_t size, struct malloc_type *mtp, int flags)
|
||||
{
|
||||
uma_slab_t slab;
|
||||
unsigned long alloc;
|
||||
@ -815,7 +815,7 @@ realloc(void *addr, unsigned long size, struct malloc_type *mtp, int flags)
|
||||
* reallocf: same as realloc() but free memory on failure.
|
||||
*/
|
||||
void *
|
||||
reallocf(void *addr, unsigned long size, struct malloc_type *mtp, int flags)
|
||||
reallocf(void *addr, size_t size, struct malloc_type *mtp, int flags)
|
||||
{
|
||||
void *mem;
|
||||
|
||||
|
@ -181,11 +181,10 @@ void *contigmalloc_domain(unsigned long size, struct malloc_type *type,
|
||||
__malloc_like __result_use_check __alloc_size(1) __alloc_align(6);
|
||||
void free(void *addr, struct malloc_type *type);
|
||||
void free_domain(void *addr, struct malloc_type *type);
|
||||
void *malloc(unsigned long size, struct malloc_type *type, int flags)
|
||||
__malloc_like __result_use_check __alloc_size(1);
|
||||
void *malloc_domain(unsigned long size, struct malloc_type *type,
|
||||
int domain, int flags)
|
||||
__malloc_like __result_use_check __alloc_size(1);
|
||||
void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like
|
||||
__result_use_check __alloc_size(1);
|
||||
void *malloc_domain(size_t size, struct malloc_type *type, int domain,
|
||||
int flags) __malloc_like __result_use_check __alloc_size(1);
|
||||
void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type,
|
||||
int flags) __malloc_like __result_use_check
|
||||
__alloc_size2(1, 2);
|
||||
@ -195,10 +194,10 @@ void malloc_type_allocated(struct malloc_type *type, unsigned long size);
|
||||
void malloc_type_freed(struct malloc_type *type, unsigned long size);
|
||||
void malloc_type_list(malloc_type_list_func_t *, void *);
|
||||
void malloc_uninit(void *);
|
||||
void *realloc(void *addr, unsigned long size, struct malloc_type *type,
|
||||
int flags) __result_use_check __alloc_size(2);
|
||||
void *reallocf(void *addr, unsigned long size, struct malloc_type *type,
|
||||
int flags) __result_use_check __alloc_size(2);
|
||||
void *realloc(void *addr, size_t size, struct malloc_type *type, int flags)
|
||||
__result_use_check __alloc_size(2);
|
||||
void *reallocf(void *addr, size_t size, struct malloc_type *type, int flags)
|
||||
__result_use_check __alloc_size(2);
|
||||
|
||||
struct malloc_type *malloc_desc2type(const char *desc);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user