From e32551b18f4560056d2d482f5e1505b1b98fa82a Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 29 Mar 2005 18:07:58 +0000 Subject: *** empty log message *** --- runtime/docs/html/group__alloc.html | 247 ++++++++++++++++++++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 runtime/docs/html/group__alloc.html (limited to 'runtime/docs/html/group__alloc.html') diff --git a/runtime/docs/html/group__alloc.html b/runtime/docs/html/group__alloc.html new file mode 100644 index 00000000..1a3e32b2 --- /dev/null +++ b/runtime/docs/html/group__alloc.html @@ -0,0 +1,247 @@ + + +SystemTap: Memory Functions + + + +
Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages
+

Memory Functions

Basic malloc/calloc/free functions. +More... + + + + + + + + + + + + + + + + + + + + + + + +

Enumerations

enum  errorcode { ERR_NONE = 0, +ERR_NO_MEM + }

Functions

void * _stp_alloc (size_t len)
 Allocates memory within a probe.
void * _stp_calloc (size_t len)
 Allocates and clears memory within a probe.
void * _stp_valloc (size_t len)
 Allocates and clears memory outside a probe.
void _stp_free (void *ptr)
 Frees memory allocated by _stp_alloc or _stp_calloc.
void _stp_vfree (void *ptr)
 Frees memory allocated by _stp_valloc.

Variables

+enum errorcode _stp_error = ERR_NONE
+

Detailed Description

+Basic malloc/calloc/free functions. +

+These will be changed so that memory allocation errors will call a handler. The default will send a signal to the user-space daemon that will trigger the module to be unloaded.

+

Todo:
Need error handling for memory allocations
+

+

Todo:
Some of these currently use kmalloc (GFP_ATOMIC) for small allocations. This should be evaluated for performance and stability.
+

Function Documentation

+

+ + + + +
+ + + + + + + + + +
void* _stp_alloc size_t  len  ) 
+
+ + + + + +
+   + + +

+Allocates memory within a probe. +

+This is used for small allocations from within a running probe where the process cannot sleep.

Parameters:
+ + +
len Number of bytes to allocate.
+
+
Returns:
a valid pointer on success or NULL on failure.
+
Bug:
Currently uses kmalloc (GFP_ATOMIC).
+ +

+Definition at line 31 of file alloc.c. +

+Referenced by _stp_calloc(), and _stp_map_set_str().

+

+ + + + +
+ + + + + + + + + +
void* _stp_calloc size_t  len  ) 
+
+ + + + + +
+   + + +

+Allocates and clears memory within a probe. +

+This is used for small allocations from within a running probe where the process cannot sleep.

Parameters:
+ + +
len Number of bytes to allocate.
+
+
Returns:
a valid pointer on success or NULL on failure.
+
Bug:
Currently uses kmalloc (GFP_ATOMIC).
+ +

+Definition at line 47 of file alloc.c. +

+References _stp_alloc(). +

+Referenced by _stp_map_set_stat(), and _stp_map_set_str().

+

+ + + + +
+ + + + + + + + + +
void _stp_free void *  ptr  ) 
+
+ + + + + +
+   + + +

+Frees memory allocated by _stp_alloc or _stp_calloc. +

+

Parameters:
+ + +
ptr pointer to memory to free
+
+ +

+Definition at line 76 of file alloc.c. +

+Referenced by _stp_list_clear(), _stp_map_key_del(), and _stp_map_set_str().

+

+ + + + +
+ + + + + + + + + +
void* _stp_valloc size_t  len  ) 
+
+ + + + + +
+   + + +

+Allocates and clears memory outside a probe. +

+This is typically used in the module initialization to allocate new maps, lists, etc.

Parameters:
+ + +
len Number of bytes to allocate.
+
+
Returns:
a valid pointer on success or NULL on failure.
+ +

+Definition at line 62 of file alloc.c. +

+Referenced by _stp_map_new().

+

+ + + + +
+ + + + + + + + + +
void _stp_vfree void *  ptr  ) 
+
+ + + + + +
+   + + +

+Frees memory allocated by _stp_valloc. +

+

Parameters:
+ + +
ptr pointer to memory to free
+
+ +

+Definition at line 86 of file alloc.c. +

+Referenced by _stp_map_del().

+ -- cgit