iPXE
Data Structures | Macros | Functions | Variables
malloc.h File Reference

Dynamic memory allocation. More...

#include <stdint.h>
#include <stdlib.h>
#include <ipxe/tables.h>
#include <valgrind/memcheck.h>

Go to the source code of this file.

Data Structures

struct  cache_discarder
 A cache discarder. More...
 

Macros

#define CACHE_DISCARDERS   __table ( struct cache_discarder, "cache_discarders" )
 Cache discarder table. More...
 
#define __cache_discarder(cost)   __table_entry ( CACHE_DISCARDERS, cost )
 Declare a cache discarder. More...
 
#define CACHE_CHEAP   01
 Items with a low replacement cost. More...
 
#define CACHE_NORMAL   02
 Items with a normal replacement cost. More...
 
#define CACHE_EXPENSIVE   03
 Items with a high replacement cost. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
void *__malloc alloc_memblock (size_t size, size_t align, size_t offset)
 Allocate a memory block. More...
 
void free_memblock (void *ptr, size_t size)
 Free a memory block. More...
 
void mpopulate (void *start, size_t len)
 Add memory to allocation pool. More...
 
void mdumpfree (void)
 
static void *__malloc malloc_phys_offset (size_t size, size_t phys_align, size_t offset)
 Allocate memory with specified physical alignment and offset. More...
 
static void *__malloc malloc_phys (size_t size, size_t phys_align)
 Allocate memory with specified physical alignment. More...
 
static void free_phys (void *ptr, size_t size)
 Free memory allocated with malloc_phys() More...
 

Variables

size_t freemem
 Total amount of free memory. More...
 
size_t usedmem
 Total amount of used memory. More...
 
size_t maxusedmem
 Maximum amount of used memory. More...
 
struct cache_discarder __attribute__
 

Detailed Description

Dynamic memory allocation.

Definition in file malloc.h.

Macro Definition Documentation

◆ CACHE_DISCARDERS

#define CACHE_DISCARDERS   __table ( struct cache_discarder, "cache_discarders" )

Cache discarder table.

Definition at line 93 of file malloc.h.

◆ __cache_discarder

#define __cache_discarder (   cost)    __table_entry ( CACHE_DISCARDERS, cost )

Declare a cache discarder.

Definition at line 96 of file malloc.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ alloc_memblock()

void* __malloc alloc_memblock ( size_t  size,
size_t  align,
size_t  offset 
)

Allocate a memory block.

Parameters
sizeRequested size
alignPhysical alignment
offsetOffset from physical alignment
Return values
ptrMemory block, or NULL

Allocates a memory block physically aligned as requested. No guarantees are provided for the alignment of the virtual address.

align must be a power of two. size may not be zero.

Definition at line 279 of file malloc.c.

279  {
280  struct memory_block *block;
281  size_t align_mask;
282  size_t actual_size;
283  size_t pre_size;
284  size_t post_size;
285  struct memory_block *pre;
286  struct memory_block *post;
287  unsigned int discarded;
288  void *ptr;
289 
290  /* Sanity checks */
291  assert ( size != 0 );
292  assert ( ( align == 0 ) || ( ( align & ( align - 1 ) ) == 0 ) );
294  check_blocks();
295 
296  /* Round up size to multiple of MIN_MEMBLOCK_SIZE and
297  * calculate alignment mask.
298  */
299  actual_size = ( ( size + MIN_MEMBLOCK_SIZE - 1 ) &
300  ~( MIN_MEMBLOCK_SIZE - 1 ) );
301  if ( ! actual_size ) {
302  /* The requested size is not permitted to be zero. A
303  * zero result at this point indicates that either the
304  * original requested size was zero, or that unsigned
305  * integer overflow has occurred.
306  */
307  ptr = NULL;
308  goto done;
309  }
310  assert ( actual_size >= size );
311  align_mask = ( ( align - 1 ) | ( MIN_MEMBLOCK_SIZE - 1 ) );
312 
313  DBGC2 ( &heap, "Allocating %#zx (aligned %#zx+%zx)\n",
314  size, align, offset );
315  while ( 1 ) {
316  /* Search through blocks for the first one with enough space */
317  list_for_each_entry ( block, &free_blocks, list ) {
318  pre_size = ( ( offset - virt_to_phys ( block ) )
319  & align_mask );
320  if ( ( block->size < pre_size ) ||
321  ( ( block->size - pre_size ) < actual_size ) )
322  continue;
323  post_size = ( block->size - pre_size - actual_size );
324  /* Split block into pre-block, block, and
325  * post-block. After this split, the "pre"
326  * block is the one currently linked into the
327  * free list.
328  */
329  pre = block;
330  block = ( ( ( void * ) pre ) + pre_size );
331  post = ( ( ( void * ) block ) + actual_size );
332  DBGC2 ( &heap, "[%p,%p) -> [%p,%p) + [%p,%p)\n", pre,
333  ( ( ( void * ) pre ) + pre->size ), pre, block,
334  post, ( ( ( void * ) pre ) + pre->size ) );
335  /* If there is a "post" block, add it in to
336  * the free list. Leak it if it is too small
337  * (which can happen only at the very end of
338  * the heap).
339  */
340  if ( post_size >= MIN_MEMBLOCK_SIZE ) {
342  sizeof ( *post ));
343  post->size = post_size;
344  list_add ( &post->list, &pre->list );
345  }
346  /* Shrink "pre" block, leaving the main block
347  * isolated and no longer part of the free
348  * list.
349  */
350  pre->size = pre_size;
351  /* If there is no "pre" block, remove it from
352  * the list. Also remove it (i.e. leak it) if
353  * it is too small, which can happen only at
354  * the very start of the heap.
355  */
356  if ( pre_size < MIN_MEMBLOCK_SIZE ) {
357  list_del ( &pre->list );
359  sizeof ( *pre ) );
360  }
361  /* Update memory usage statistics */
362  freemem -= actual_size;
363  usedmem += actual_size;
364  if ( usedmem > maxusedmem )
366  /* Return allocated block */
367  DBGC2 ( &heap, "Allocated [%p,%p)\n", block,
368  ( ( ( void * ) block ) + size ) );
369  ptr = block;
371  goto done;
372  }
373 
374  /* Try discarding some cached data to free up memory */
375  DBGC ( &heap, "Attempting discard for %#zx (aligned %#zx+%zx), "
376  "used %zdkB\n", size, align, offset, ( usedmem >> 10 ) );
378  discarded = discard_cache();
380  check_blocks();
381  if ( ! discarded ) {
382  /* Nothing available to discard */
383  DBGC ( &heap, "Failed to allocate %#zx (aligned "
384  "%#zx)\n", size, align );
385  ptr = NULL;
386  goto done;
387  }
388  }
389 
390  done:
391  check_blocks();
393  return ptr;
394 }
static __always_inline void struct dma_mapping size_t size_t align
Definition: dma.h:222
#define list_add(new, head)
Add a new entry to the head of a list.
Definition: list.h:69
#define DBGC(...)
Definition: compiler.h:505
static void valgrind_make_blocks_noaccess(void)
Mark all blocks in free list as inaccessible.
Definition: malloc.c:157
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
Definition: uaccess.h:287
static char heap[HEAP_SIZE]
The heap itself.
Definition: malloc.c:110
struct list_head list
List of free blocks.
Definition: malloc.c:59
#define list_del(list)
Delete an entry from a list.
Definition: list.h:119
size_t freemem
Total amount of free memory.
Definition: malloc.c:94
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void check_blocks(void)
Check integrity of the blocks in the free list.
Definition: malloc.c:205
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:431
static userptr_t size_t offset
Offset of the first segment within the content.
Definition: deflate.h:259
#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr, _qzz_len)
Definition: memcheck.h:111
#define MIN_MEMBLOCK_SIZE
Definition: malloc.c:62
A free block of memory.
Definition: malloc.c:44
static unsigned int discard_cache(void)
Discard some cached data.
Definition: malloc.c:242
#define DBGC2(...)
Definition: compiler.h:522
uint8_t block[3][8]
DES-encrypted blocks.
Definition: mschapv2.h:12
size_t size
Size of this block.
Definition: malloc.c:46
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
static void valgrind_make_blocks_defined(void)
Mark all blocks in free list as defined.
Definition: malloc.c:116
#define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr, _qzz_len)
Definition: memcheck.h:121
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
size_t maxusedmem
Maximum amount of used memory.
Definition: malloc.c:100
struct bofm_section_header done
Definition: bofm_test.c:46
size_t usedmem
Total amount of used memory.
Definition: malloc.c:97

References align, assert(), block, check_blocks(), DBGC, DBGC2, discard_cache(), done, freemem, heap, memory_block::list, list_add, list_del, list_for_each_entry, maxusedmem, MIN_MEMBLOCK_SIZE, NULL, offset, size, memory_block::size, usedmem, valgrind_make_blocks_defined(), valgrind_make_blocks_noaccess(), VALGRIND_MAKE_MEM_NOACCESS, VALGRIND_MAKE_MEM_UNDEFINED, and virt_to_phys().

Referenced by malloc_phys_offset(), and realloc().

◆ free_memblock()

void free_memblock ( void *  ptr,
size_t  size 
)

Free a memory block.

Parameters
ptrMemory allocated by alloc_memblock(), or NULL
sizeSize of the memory

If ptr is NULL, no action is taken.

Definition at line 404 of file malloc.c.

404  {
405  struct memory_block *freeing;
406  struct memory_block *block;
407  struct memory_block *tmp;
408  size_t actual_size;
409  ssize_t gap_before;
410  ssize_t gap_after = -1;
411 
412  /* Allow for ptr==NULL */
413  if ( ! ptr )
414  return;
416 
417  /* Sanity checks */
419  check_blocks();
420 
421  /* Round up size to match actual size that alloc_memblock()
422  * would have used.
423  */
424  assert ( size != 0 );
425  actual_size = ( ( size + MIN_MEMBLOCK_SIZE - 1 ) &
426  ~( MIN_MEMBLOCK_SIZE - 1 ) );
427  freeing = ptr;
428  VALGRIND_MAKE_MEM_UNDEFINED ( freeing, sizeof ( *freeing ) );
429  DBGC2 ( &heap, "Freeing [%p,%p)\n",
430  freeing, ( ( ( void * ) freeing ) + size ) );
431 
432  /* Check that this block does not overlap the free list */
433  if ( ASSERTING ) {
434  list_for_each_entry ( block, &free_blocks, list ) {
435  if ( ( ( ( void * ) block ) <
436  ( ( void * ) freeing + actual_size ) ) &&
437  ( ( void * ) freeing <
438  ( ( void * ) block + block->size ) ) ) {
439  assert ( 0 );
440  DBGC ( &heap, "Double free of [%p,%p) "
441  "overlapping [%p,%p) detected from %p\n",
442  freeing,
443  ( ( ( void * ) freeing ) + size ), block,
444  ( ( void * ) block + block->size ),
445  __builtin_return_address ( 0 ) );
446  }
447  }
448  }
449 
450  /* Insert/merge into free list */
451  freeing->size = actual_size;
452  list_for_each_entry_safe ( block, tmp, &free_blocks, list ) {
453  /* Calculate gaps before and after the "freeing" block */
454  gap_before = ( ( ( void * ) freeing ) -
455  ( ( ( void * ) block ) + block->size ) );
456  gap_after = ( ( ( void * ) block ) -
457  ( ( ( void * ) freeing ) + freeing->size ) );
458  /* Merge with immediately preceding block, if possible */
459  if ( gap_before == 0 ) {
460  DBGC2 ( &heap, "[%p,%p) + [%p,%p) -> [%p,%p)\n", block,
461  ( ( ( void * ) block ) + block->size ), freeing,
462  ( ( ( void * ) freeing ) + freeing->size ),
463  block,
464  ( ( ( void * ) freeing ) + freeing->size ) );
465  block->size += actual_size;
466  list_del ( &block->list );
467  VALGRIND_MAKE_MEM_NOACCESS ( freeing,
468  sizeof ( *freeing ) );
469  freeing = block;
470  }
471  /* Stop processing as soon as we reach a following block */
472  if ( gap_after >= 0 )
473  break;
474  }
475 
476  /* Insert before the immediately following block. If
477  * possible, merge the following block into the "freeing"
478  * block.
479  */
480  DBGC2 ( &heap, "[%p,%p)\n",
481  freeing, ( ( ( void * ) freeing ) + freeing->size ) );
482  list_add_tail ( &freeing->list, &block->list );
483  if ( gap_after == 0 ) {
484  DBGC2 ( &heap, "[%p,%p) + [%p,%p) -> [%p,%p)\n", freeing,
485  ( ( ( void * ) freeing ) + freeing->size ), block,
486  ( ( ( void * ) block ) + block->size ), freeing,
487  ( ( ( void * ) block ) + block->size ) );
488  freeing->size += block->size;
489  list_del ( &block->list );
490  VALGRIND_MAKE_MEM_NOACCESS ( block, sizeof ( *block ) );
491  }
492 
493  /* Update memory usage statistics */
494  freemem += actual_size;
495  usedmem -= actual_size;
496 
497  check_blocks();
499 }
#define DBGC(...)
Definition: compiler.h:505
static void valgrind_make_blocks_noaccess(void)
Mark all blocks in free list as inaccessible.
Definition: malloc.c:157
static char heap[HEAP_SIZE]
The heap itself.
Definition: malloc.c:110
unsigned long tmp
Definition: linux_pci.h:53
struct list_head list
List of free blocks.
Definition: malloc.c:59
#define list_del(list)
Delete an entry from a list.
Definition: list.h:119
size_t freemem
Total amount of free memory.
Definition: malloc.c:94
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void check_blocks(void)
Check integrity of the blocks in the free list.
Definition: malloc.c:205
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:431
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
Definition: list.h:93
#define ASSERTING
Definition: assert.h:19
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
Definition: list.h:458
#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr, _qzz_len)
Definition: memcheck.h:111
#define MIN_MEMBLOCK_SIZE
Definition: malloc.c:62
A free block of memory.
Definition: malloc.c:44
#define DBGC2(...)
Definition: compiler.h:522
uint8_t block[3][8]
DES-encrypted blocks.
Definition: mschapv2.h:12
size_t size
Size of this block.
Definition: malloc.c:46
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
static void valgrind_make_blocks_defined(void)
Mark all blocks in free list as defined.
Definition: malloc.c:116
signed long ssize_t
Definition: stdint.h:7
#define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr, _qzz_len)
Definition: memcheck.h:121
size_t usedmem
Total amount of used memory.
Definition: malloc.c:97

References assert(), ASSERTING, block, check_blocks(), DBGC, DBGC2, freemem, heap, memory_block::list, list_add_tail, list_del, list_for_each_entry, list_for_each_entry_safe, MIN_MEMBLOCK_SIZE, size, tmp, usedmem, valgrind_make_blocks_defined(), valgrind_make_blocks_noaccess(), VALGRIND_MAKE_MEM_NOACCESS, and VALGRIND_MAKE_MEM_UNDEFINED.

Referenced by free_phys(), mpopulate(), and realloc().

◆ mpopulate()

void mpopulate ( void *  start,
size_t  len 
)

Add memory to allocation pool.

Parameters
startStart address
endEnd address

Adds a block of memory [start,end) to the allocation pool. This is a one-way operation; there is no way to reclaim this memory.

start must be aligned to at least a multiple of sizeof(void*).

Definition at line 648 of file malloc.c.

648  {
649 
650  /* Prevent free_memblock() from rounding up len beyond the end
651  * of what we were actually given...
652  */
653  len &= ~( MIN_MEMBLOCK_SIZE - 1 );
654 
655  /* Add to allocation pool */
656  free_memblock ( start, len );
657 
658  /* Fix up memory usage statistics */
659  usedmem += len;
660 }
void free_memblock(void *ptr, size_t size)
Free a memory block.
Definition: malloc.c:404
uint32_t start
Starting offset.
Definition: netvsc.h:12
#define MIN_MEMBLOCK_SIZE
Definition: malloc.c:62
uint32_t len
Length.
Definition: ena.h:14
size_t usedmem
Total amount of used memory.
Definition: malloc.c:97

References free_memblock(), len, MIN_MEMBLOCK_SIZE, start, and usedmem.

Referenced by init_heap().

◆ mdumpfree()

void mdumpfree ( void  )

◆ malloc_phys_offset()

static void* __malloc malloc_phys_offset ( size_t  size,
size_t  phys_align,
size_t  offset 
)
inlinestatic

Allocate memory with specified physical alignment and offset.

Parameters
sizeRequested size
alignPhysical alignment
offsetOffset from physical alignment
Return values
ptrMemory, or NULL

align must be a power of two. size may not be zero.

Definition at line 44 of file malloc.h.

46  {
47  void * ptr = alloc_memblock ( size, phys_align, offset );
48  if ( ptr && size )
49  VALGRIND_MALLOCLIKE_BLOCK ( ptr, size, 0, 0 );
50  return ptr;
51 }
void *__malloc alloc_memblock(size_t size, size_t align, size_t offset)
Allocate a memory block.
Definition: malloc.c:279
static userptr_t size_t offset
Offset of the first segment within the content.
Definition: deflate.h:259
#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed)
Definition: valgrind.h:4411
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16

References alloc_memblock(), offset, size, and VALGRIND_MALLOCLIKE_BLOCK.

Referenced by alloc_iob_raw(), and malloc_phys().

◆ malloc_phys()

static void* __malloc malloc_phys ( size_t  size,
size_t  phys_align 
)
inlinestatic

Allocate memory with specified physical alignment.

Parameters
sizeRequested size
alignPhysical alignment
Return values
ptrMemory, or NULL

align must be a power of two. size may not be zero.

Definition at line 62 of file malloc.h.

62  {
63  return malloc_phys_offset ( size, phys_align, 0 );
64 }
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
static void *__malloc malloc_phys_offset(size_t size, size_t phys_align, size_t offset)
Allocate memory with specified physical alignment and offset.
Definition: malloc.h:44

References malloc_phys_offset(), and size.

Referenced by __vxge_hw_fifo_create(), __vxge_hw_ring_create(), a3c90x_setup_rx_ring(), a3c90x_setup_tx_ring(), arbel_alloc(), arbel_alloc_icm(), arbel_create_cq(), arbel_create_eq(), arbel_create_recv_wq(), arbel_create_send_wq(), ath5k_desc_alloc(), ath_descdma_setup(), atl1e_setup_ring_resources(), b44_init_rx_ring(), b44_init_tx_ring(), bnxt_alloc_mem(), efx_hunt_alloc_special_buffer(), ehci_bus_open(), ehci_ring_alloc(), ena_create_admin(), ena_create_async(), ena_create_cq(), ena_create_sq(), ena_probe(), exanic_probe(), falcon_alloc_special_buffer(), golan_cmd_init(), golan_create_cq(), golan_create_eq(), golan_create_qp_aux(), hermon_alloc(), hermon_create_cq(), hermon_create_eq(), hermon_create_qp(), hv_alloc_message(), hv_alloc_pages(), hvm_map_hypercall(), icplus_create_ring(), ifec_net_open(), ifec_tx_setup(), igbvf_setup_rx_resources(), igbvf_setup_tx_resources(), jme_alloc_rx_resources(), jme_alloc_tx_resources(), linda_create_recv_wq(), linda_init_send(), mlx_memory_alloc_dma_priv(), myri10ge_net_open(), myson_create_ring(), natsemi_create_ring(), netfront_create_ring(), nv_init_rings(), pcnet32_setup_rx_resources(), pcnet32_setup_tx_resources(), phantom_create_rx_ctx(), phantom_create_tx_ctx(), phantom_open(), qib7322_create_recv_wq(), qib7322_init_send(), rhine_create_ring(), rtl818x_init_rx_ring(), rtl818x_init_tx_ring(), sis190_open(), skge_up(), sky2_probe(), sky2_up(), tg3_alloc_consistent(), tg3_test_dma(), uhci_bus_open(), uhci_enqueue(), uhci_ring_alloc(), velocity_alloc_rings(), vmbus_open(), and vmxnet3_open().

◆ free_phys()

static void free_phys ( void *  ptr,
size_t  size 
)
inlinestatic

Free memory allocated with malloc_phys()

Parameters
ptrMemory allocated by malloc_phys(), or NULL
sizeSize of memory, as passed to malloc_phys()

Memory allocated with malloc_phys() can only be freed with free_phys(); it cannot be freed with the standard free().

If ptr is NULL, no action is taken.

Definition at line 77 of file malloc.h.

77  {
78  VALGRIND_FREELIKE_BLOCK ( ptr, 0 );
79  free_memblock ( ptr, size );
80 }
void free_memblock(void *ptr, size_t size)
Free a memory block.
Definition: malloc.c:404
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
#define VALGRIND_FREELIKE_BLOCK(addr, rzB)
Definition: valgrind.h:4421

References free_memblock(), size, and VALGRIND_FREELIKE_BLOCK.

Referenced by __vxge_hw_fifo_delete(), __vxge_hw_ring_delete(), a3c90x_free_rx_ring(), a3c90x_free_tx_ring(), alloc_iob_raw(), arbel_alloc(), arbel_alloc_icm(), arbel_create_cq(), arbel_create_eq(), arbel_create_qp(), arbel_create_recv_wq(), arbel_destroy_cq(), arbel_destroy_eq(), arbel_destroy_qp(), arbel_free(), arbel_free_icm(), ath5k_desc_alloc(), ath5k_desc_free(), ath_descdma_cleanup(), ath_descdma_setup(), atl1e_free_ring_resources(), b44_free_rx_ring(), b44_free_tx_ring(), b44_init_rx_ring(), b44_init_tx_ring(), bnxt_free_mem(), efx_hunt_free_special_buffer(), ehci_bus_close(), ehci_bus_open(), ehci_ring_alloc(), ehci_ring_free(), ena_create_admin(), ena_create_async(), ena_create_cq(), ena_create_sq(), ena_destroy_admin(), ena_destroy_async(), ena_destroy_cq(), ena_destroy_sq(), ena_probe(), ena_remove(), exanic_probe(), exanic_remove(), falcon_free_special_buffer(), free_iob(), golan_cmd_init(), golan_cmd_uninit(), golan_create_cq(), golan_create_eq(), golan_create_qp_aux(), golan_destory_eq(), golan_destroy_cq(), golan_destroy_qp(), hermon_alloc(), hermon_create_cq(), hermon_create_eq(), hermon_create_qp(), hermon_destroy_cq(), hermon_destroy_eq(), hermon_destroy_qp(), hermon_free(), hv_alloc_pages(), hv_free_message(), hv_free_pages(), hvm_unmap_hypercall(), icplus_create_ring(), icplus_destroy_ring(), ifec_free(), ifec_net_open(), igbvf_free_rx_resources(), igbvf_free_tx_resources(), jme_free_rx_resources(), jme_free_tx_resources(), linda_create_recv_wq(), linda_destroy_recv_wq(), linda_fini_send(), linda_init_send(), mlx_memory_free_dma_priv(), myri10ge_net_close(), myri10ge_net_open(), myson_create_ring(), myson_destroy_ring(), natsemi_create_ring(), natsemi_destroy_ring(), netfront_create_ring(), netfront_destroy_ring(), nv_free_rxtx_resources(), pcnet32_free_rx_resources(), pcnet32_free_tx_resources(), phantom_close(), phantom_create_rx_ctx(), phantom_create_tx_ctx(), phantom_open(), qib7322_create_recv_wq(), qib7322_destroy_recv_wq(), qib7322_fini_send(), qib7322_init_send(), rhine_destroy_ring(), rtl818x_free_rx_ring(), rtl818x_free_tx_ring(), sis190_free(), skge_free(), sky2_free_rings(), sky2_probe(), sky2_remove(), tg3_free_consistent(), tg3_rx_prodring_fini(), tg3_test_dma(), uhci_bus_close(), uhci_bus_open(), uhci_dequeue(), uhci_enqueue(), uhci_ring_alloc(), uhci_ring_free(), velocity_alloc_rings(), velocity_close(), vmbus_close(), vmbus_open(), vmxnet3_close(), and vmxnet3_open().

Variable Documentation

◆ freemem

size_t freemem

Total amount of free memory.

Definition at line 94 of file malloc.c.

Referenced by alloc_memblock(), and free_memblock().

◆ usedmem

size_t usedmem

Total amount of used memory.

Definition at line 97 of file malloc.c.

Referenced by alloc_memblock(), free_memblock(), and mpopulate().

◆ maxusedmem

size_t maxusedmem

Maximum amount of used memory.

Definition at line 100 of file malloc.c.

Referenced by alloc_memblock(), and shutdown_cache().

◆ __attribute__