bsdmalloc(3malloc) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

bsdmalloc(3malloc)

Memory Allocation Library Functions                         bsdmalloc(3MALLOC)



NAME
       bsdmalloc - memory allocator

SYNOPSIS
       cc [ flag ... ] file ... -lbsdmalloc [ library ... ]


       #include <stdlib.h>

       void *malloc(size_t size);


       void *calloc(size_t nelem, size_t elsize);


       void *memalign(size_t alignment, size_t size);


       void *realloc(void *ptr, size_t size);


       void *valloc(size_t size);


       size_t malloc_usable_size(void *ptr);


       void free(void *ptr);

DESCRIPTION
       These  routines  provide  a  general-purpose memory allocation package.
       They maintain a table of free blocks for efficient allocation and  coa‐
       lescing  of free storage. When there is no suitable space already free,
       the allocation routines call sbrk(2) to get more memory from  the  sys‐
       tem.  Each  of the allocation routines returns a pointer to space suit‐
       ably aligned for storage of any type of object.  Each  returns  a  null
       pointer if the request cannot be completed.


       They operate as described on the malloc(3C) manual page, except for the
       following differences:

           o      For historical backward compatibility, realloc()  accepts  a
                  pointer  to  a block freed since the most recent call to one
                  of the allocation functions.


           o      Support for using adi(7) is not available.


           o      Entry points for memalign() and valloc() are empty  routines
                  that  return  failure,  and are provided only to protect the
                  user from mixing malloc() functions from different implemen‐
                  tations. This will also cause calls to aligned_alloc(3C) and
                  posix_memalign(3C) to fail.


USAGE
       Using realloc() with a block freed before the most recent call to  mal‐
       loc(), calloc(), or realloc() results in an error.


       See  malloc(3C)  for  an  overview and comparison of all the allocation
       libraries provided by Oracle Solaris.

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelUnsafe


SEE ALSO
       brk(2), malloc(3C), libbsdmalloc(3LIB)

WARNINGS
       Use of libbsdmalloc renders an application non-SCD compliant.


       The libbsdmalloc routines must not be mixed with other malloc implemen‐
       tations within a single process. Such use is undefined  and  may  cause
       corruption or other failure.



Oracle Solaris 11.4               11 May 2021               bsdmalloc(3MALLOC)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3