Lines Matching +full:single +full:- +full:tt
11 <br> $Id: heap.html,v 1.9 2000-12-08 21:41:42 ca Exp $
17 <tt>malloc</tt>, <tt>realloc</tt> and <tt>free</tt>
60 <tt>sm_malloc</tt>, <tt>sm_realloc</tt> and <tt>sm_free</tt>
62 for <tt>malloc</tt>, <tt>realloc</tt> and <tt>free</tt> that provide
64 <tt>sm_malloc_x</tt> and <tt>sm_realloc_x</tt>
66 <tt>sm_malloc</tt> and <tt>sm_realloc</tt>
69 all calls to <tt>malloc</tt>, <tt>realloc</tt> and <tt>free</tt>
71 to the corresponding <tt>sm_</tt>* routines.
75 <tt> void *sm_malloc(size_t size) </tt>
77 This function is a plug-in replacement for <tt>malloc</tt>.
78 It allocates <tt>size</tt> bytes of memory on the heap
80 or it returns <tt>NULL</tt> on failure.
83 The C standard says that <tt>malloc(0)</tt> may return
84 either <tt>NULL</tt> or a non-<tt>NULL</tt> value.
86 <tt>sm_malloc(0)</tt> is equivalent to <tt>sm_malloc(1)</tt>.
89 In addition, if heap checking is enabled, then <tt>sm_malloc</tt>
92 checking in <tt>sm_realloc</tt> and <tt>sm_free</tt>,
93 and it can be printed using <tt>sm_heap_report</tt>
98 <tt> void *sm_malloc_x(size_t size) </tt>
100 This function is just like <tt>sm_malloc</tt>
101 except that it raises the <tt>SmHeapOutOfMemory</tt> exception
102 instead of returning <tt>NULL</tt> on error.
106 <tt> void *sm_realloc(void *ptr, size_t size) </tt>
108 This function is a plug-in replacement for <tt>realloc</tt>.
109 If <tt>ptr</tt> is null then this call is equivalent
110 to <tt>sm_malloc(size)</tt>.
111 Otherwise, the size of the object pointed to by <tt>ptr</tt>
112 is changed to <tt>size</tt> bytes, and a pointer to the
115 by <tt>ptr</tt> is unchanged and <tt>NULL</tt> is returned.
118 If <tt>size</tt> is 0 then we pretend that <tt>size</tt> is 1.
130 <tt> void *sm_realloc_x(void *ptr, size_t size) </tt>
132 This function is just like <tt>sm_realloc</tt>
134 instead of returning <tt>NULL</tt> on error.
138 <tt> void sm_free(void *ptr) </tt>
140 This function is a plug-in replacement for free.
168 <tt> size_t size </tt>
172 <tt> char *tag </tt>
176 string pointer, or <tt>NULL</tt>.
178 <tt> int num </tt>
183 <tt> int group </tt>
189 <tt>sm_malloc</tt> and <tt>sm_malloc_x</tt> will be assigned
193 These tag values are printed by <tt>sm_heap_report</tt>,
201 <tt> void *sm_malloc_tagged(size_t size, int tag, int num, int group) </tt>
203 Just like <tt>sm_malloc</tt>, except you directly specify
206 to <tt>sm_malloc_tagged</tt> is macro expanded to
207 a call to <tt>malloc</tt>.
210 Note that the expression <tt>sm_malloc(size)</tt> is macro expanded to
217 <tt> void *sm_malloc_tagged_x(size_t size, int tag, int num, int group) </tt>
219 A variant of <tt>sm_malloc_tagged</tt>
221 A call to <tt>sm_malloc_x</tt> is macro expanded
222 to a call to <tt>sm_malloc_tagged_x</tt>.
226 <tt> int sm_heap_group() </tt>
228 The heap package maintains a thread-local variable containing
230 This is the group that <tt>sm_malloc</tt> and <tt>sm_malloc_x</tt>
234 <tt>sm_heap_group()</tt>.
238 <tt> int sm_heap_setgroup(int g) </tt>
248 and call <tt>sm_heap_report(stdout,2)</tt>
317 <tt> void sm_heap_report(FILE *stream, int verbosity) </tt>
323 If verbosity >= 1, then sm_heap_report prints a single line
348 If you compile your software with -DSM_HEAP_CHECK=0 then
353 If you do not define -DSM_HEAP_CHECK=0, and you do not explicitly
360 If you do not define -DSM_HEAP_CHECK=0, and you explicitly turn on
368 Make sure that there is a -d command line option that
377 sm_heap_report(stdout, sm_debug_level(&SmHeapCheck) - 1);
381 To turn on heap checking, use the command line option "-dsm_check_heap.1".
387 The command line option "-dsm_check_heap.2" will cause your application
389 That will print a single line reporting total storage allocation.
392 The command line option "-dsm_check_heap.3" will cause your application
397 The command line option "-dsm_check_heap.4" will cause your application
420 This function returns <tt>true</tt> on success,
421 or <tt>false</tt> if it failed due to heap exhaustion.