FREE man page on DigitalUNIX

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
DigitalUNIX logo
[printable version]

FREE(9r)							      FREE(9r)

       FREE - General: Deallocates (frees) the allocated kernel virtual memory

       #include <sys/malloc.h>

	       void *addr,
	       int type );

       Specifies  the memory pointer that points to the allocated memory to be
       freed. You must have previously set this pointer in the call to MALLOC.
       You  also define the data type for this argument in the call to MALLOC.
       Specifies the purpose for which the memory  is  being  allocated.   The
       memory types are defined in the file <malloc.h>. Typically, kernel mod‐
       ules use the constant M_DEVBUF to indicate that kernel module memory is
       being allocated (or freed).

       The  FREE routine deallocates (frees) the allocated kernel virtual mem‐
       ory, which you allocated in a previous call to MALLOC.

       A memory corruption can occur if a kernel module continues to  use  the
       memory after freeing it. The operating system provides a built-in mech‐
       anism to debug such erroneous use of memory. You can enable this debug‐
       ging  feature  at  boot time by providing the following boot parameter:
       kmem_debug=1. When you enable this debugging feature, the FREE  routine
       stores  the  following  in  the	last word of freed memory: The program
       counter (pc) of the module that last freed the memory The  checksum  of
       the memory content

       The  MALLOC  routine  checks  the checksum of the memory content before
       reallocating this corrupted memory. If the checksum of the memory  con‐
       tent  does  not	match  the  corrupted  memory, MALLOC stores the debug
       information and then causes the kernel to  panic.  The  MALLOC  routine
       stores  the  address and size of the corrupted memory and the pc of the
       routine that last freed it in a kmem_corrupt_data structure.

       You should consider the following when using  this  debugging  feature:
       This  debugging	feature	 does  not  detect  cases where the corruption
       occurs after malloc reallocates the freed memory to some other  module.
       There  is a small chance that the pc of the routine that freed the mem‐
       ory (stored in the last word of freed memory) may  itself  become  cor‐


       Routines: MALLOC(9r)


List of man pages available for DigitalUNIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net