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 mdumpfree (void)
 Dump free block list (for debugging) More...
 
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 92 of file malloc.h.

◆ __cache_discarder

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

Declare a cache discarder.

Definition at line 95 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 284 of file malloc.c.

284  {
285  struct memory_block *block;
286  size_t actual_offset;
287  size_t align_mask;
288  size_t actual_size;
289  size_t pre_size;
290  size_t post_size;
291  struct memory_block *pre;
292  struct memory_block *post;
293  unsigned int discarded;
294  void *ptr;
295 
296  /* Sanity checks */
297  assert ( size != 0 );
298  assert ( ( align == 0 ) || ( ( align & ( align - 1 ) ) == 0 ) );
300  check_blocks();
301 
302  /* Calculate offset of memory block */
303  actual_offset = ( offset & ~( MEMBLOCK_ALIGN - 1 ) );
304  assert ( actual_offset <= offset );
305 
306  /* Calculate size of memory block */
307  actual_size = ( ( size + offset - actual_offset + MEMBLOCK_ALIGN - 1 )
308  & ~( MEMBLOCK_ALIGN - 1 ) );
309  if ( ! actual_size ) {
310  /* The requested size is not permitted to be zero. A
311  * zero result at this point indicates that either the
312  * original requested size was zero, or that unsigned
313  * integer overflow has occurred.
314  */
315  ptr = NULL;
316  goto done;
317  }
318  assert ( actual_size >= size );
319 
320  /* Calculate alignment mask */
321  align_mask = ( ( align - 1 ) | ( MEMBLOCK_ALIGN - 1 ) );
322 
323  DBGC2 ( &heap, "HEAP allocating %#zx (aligned %#zx+%zx)\n",
324  size, align, offset );
325  while ( 1 ) {
326  /* Search through blocks for the first one with enough space */
327  list_for_each_entry ( block, &free_blocks, list ) {
328  pre_size = ( ( actual_offset - virt_to_phys ( block ) )
329  & align_mask );
330  if ( ( block->size < pre_size ) ||
331  ( ( block->size - pre_size ) < actual_size ) )
332  continue;
333  post_size = ( block->size - pre_size - actual_size );
334  /* Split block into pre-block, block, and
335  * post-block. After this split, the "pre"
336  * block is the one currently linked into the
337  * free list.
338  */
339  pre = block;
340  block = ( ( ( void * ) pre ) + pre_size );
341  post = ( ( ( void * ) block ) + actual_size );
342  DBGC2 ( &heap, "HEAP splitting [%p,%p) -> [%p,%p) "
343  "+ [%p,%p)\n", pre,
344  ( ( ( void * ) pre ) + pre->size ), pre, block,
345  post, ( ( ( void * ) pre ) + pre->size ) );
346  /* If there is a "post" block, add it in to
347  * the free list.
348  */
349  if ( post_size ) {
350  assert ( post_size >= MEMBLOCK_ALIGN );
352  sizeof ( *post ));
353  post->size = post_size;
354  list_add ( &post->list, &pre->list );
355  }
356  /* Shrink "pre" block, leaving the main block
357  * isolated and no longer part of the free
358  * list.
359  */
360  pre->size = pre_size;
361  /* If there is no "pre" block, remove it from
362  * the list.
363  */
364  if ( ! pre_size ) {
365  list_del ( &pre->list );
367  sizeof ( *pre ) );
368  } else {
369  assert ( pre_size >= MEMBLOCK_ALIGN );
370  }
371  /* Update memory usage statistics */
372  freemem -= actual_size;
373  usedmem += actual_size;
374  if ( usedmem > maxusedmem )
376  /* Return allocated block */
377  ptr = ( ( ( void * ) block ) + offset - actual_offset );
378  DBGC2 ( &heap, "HEAP allocated [%p,%p) within "
379  "[%p,%p)\n", ptr, ( ptr + size ), block,
380  ( ( ( void * ) block ) + actual_size ) );
382  goto done;
383  }
384 
385  /* Try discarding some cached data to free up memory */
386  DBGC ( &heap, "HEAP attempting discard for %#zx (aligned "
387  "%#zx+%zx), used %zdkB\n", size, align, offset,
388  ( usedmem >> 10 ) );
390  discarded = discard_cache();
392  check_blocks();
393  if ( ! discarded ) {
394  /* Nothing available to discard */
395  DBGC ( &heap, "HEAP failed to allocate %#zx (aligned "
396  "%#zx)\n", size, align );
397  ptr = NULL;
398  goto done;
399  }
400  }
401 
402  done:
403  check_blocks();
405  return ptr;
406 }
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
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
#define DBGC(...)
Definition: compiler.h:505
static void valgrind_make_blocks_noaccess(void)
Mark all blocks in free list as inaccessible.
Definition: malloc.c:158
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
Definition: uaccess.h:361
static char heap[HEAP_SIZE]
The heap itself.
Definition: malloc.c:111
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:95
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:206
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:431
#define MEMBLOCK_ALIGN
Physical address alignment maintained for free blocks of memory.
Definition: malloc.c:63
#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr, _qzz_len)
Definition: memcheck.h:111
A free block of memory.
Definition: malloc.c:44
static unsigned int discard_cache(void)
Discard some cached data.
Definition: malloc.c:247
#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
static void valgrind_make_blocks_defined(void)
Mark all blocks in free list as defined.
Definition: malloc.c:117
uint16_t offset
Offset to command line.
Definition: bzimage.h:8
#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:101
struct bofm_section_header done
Definition: bofm_test.c:46
size_t usedmem
Total amount of used memory.
Definition: malloc.c:98

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, MEMBLOCK_ALIGN, 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 416 of file malloc.c.

416  {
417  struct memory_block *freeing;
418  struct memory_block *block;
419  struct memory_block *tmp;
420  size_t sub_offset;
421  size_t actual_size;
422  ssize_t gap_before;
423  ssize_t gap_after = -1;
424 
425  /* Allow for ptr==NULL */
426  if ( ! ptr )
427  return;
429 
430  /* Sanity checks */
432  check_blocks();
433 
434  /* Round up to match actual block that alloc_memblock() would
435  * have allocated.
436  */
437  assert ( size != 0 );
438  sub_offset = ( virt_to_phys ( ptr ) & ( MEMBLOCK_ALIGN - 1) );
439  freeing = ( ptr - sub_offset );
440  actual_size = ( ( size + sub_offset + MEMBLOCK_ALIGN - 1 ) &
441  ~( MEMBLOCK_ALIGN - 1 ) );
442  DBGC2 ( &heap, "HEAP freeing [%p,%p) within [%p,%p)\n",
443  ptr, ( ptr + size ), freeing,
444  ( ( ( void * ) freeing ) + actual_size ) );
445  VALGRIND_MAKE_MEM_UNDEFINED ( freeing, sizeof ( *freeing ) );
446 
447  /* Check that this block does not overlap the free list */
448  if ( ASSERTING ) {
449  list_for_each_entry ( block, &free_blocks, list ) {
450  if ( ( ( ( void * ) block ) <
451  ( ( void * ) freeing + actual_size ) ) &&
452  ( ( void * ) freeing <
453  ( ( void * ) block + block->size ) ) ) {
454  assert ( 0 );
455  DBGC ( &heap, "HEAP double free of [%p,%p) "
456  "overlapping [%p,%p) detected from %p\n",
457  freeing,
458  ( ( ( void * ) freeing ) + size ), block,
459  ( ( void * ) block + block->size ),
460  __builtin_return_address ( 0 ) );
461  }
462  }
463  }
464 
465  /* Insert/merge into free list */
466  freeing->size = actual_size;
467  list_for_each_entry_safe ( block, tmp, &free_blocks, list ) {
468  /* Calculate gaps before and after the "freeing" block */
469  gap_before = ( ( ( void * ) freeing ) -
470  ( ( ( void * ) block ) + block->size ) );
471  gap_after = ( ( ( void * ) block ) -
472  ( ( ( void * ) freeing ) + freeing->size ) );
473  /* Merge with immediately preceding block, if possible */
474  if ( gap_before == 0 ) {
475  DBGC2 ( &heap, "HEAP merging [%p,%p) + [%p,%p) -> "
476  "[%p,%p)\n", block,
477  ( ( ( void * ) block ) + block->size ), freeing,
478  ( ( ( void * ) freeing ) + freeing->size ),
479  block,
480  ( ( ( void * ) freeing ) + freeing->size ) );
481  block->size += actual_size;
482  list_del ( &block->list );
483  VALGRIND_MAKE_MEM_NOACCESS ( freeing,
484  sizeof ( *freeing ) );
485  freeing = block;
486  }
487  /* Stop processing as soon as we reach a following block */
488  if ( gap_after >= 0 )
489  break;
490  }
491 
492  /* Insert before the immediately following block. If
493  * possible, merge the following block into the "freeing"
494  * block.
495  */
496  DBGC2 ( &heap, "HEAP freed [%p,%p)\n",
497  freeing, ( ( ( void * ) freeing ) + freeing->size ) );
498  list_add_tail ( &freeing->list, &block->list );
499  if ( gap_after == 0 ) {
500  DBGC2 ( &heap, "HEAP merging [%p,%p) + [%p,%p) -> [%p,%p)\n",
501  freeing, ( ( ( void * ) freeing ) + freeing->size ),
502  block, ( ( ( void * ) block ) + block->size ), freeing,
503  ( ( ( void * ) block ) + block->size ) );
504  freeing->size += block->size;
505  list_del ( &block->list );
506  VALGRIND_MAKE_MEM_NOACCESS ( block, sizeof ( *block ) );
507  }
508 
509  /* Update memory usage statistics */
510  freemem += actual_size;
511  usedmem -= actual_size;
512 
513  check_blocks();
515 }
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
#define DBGC(...)
Definition: compiler.h:505
static void valgrind_make_blocks_noaccess(void)
Mark all blocks in free list as inaccessible.
Definition: malloc.c:158
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
Definition: uaccess.h:361
static char heap[HEAP_SIZE]
The heap itself.
Definition: malloc.c:111
unsigned long tmp
Definition: linux_pci.h:63
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:95
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:206
#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 MEMBLOCK_ALIGN
Physical address alignment maintained for free blocks of memory.
Definition: malloc.c:63
#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr, _qzz_len)
Definition: memcheck.h:111
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
static void valgrind_make_blocks_defined(void)
Mark all blocks in free list as defined.
Definition: malloc.c:117
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:98

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, MEMBLOCK_ALIGN, size, tmp, usedmem, valgrind_make_blocks_defined(), valgrind_make_blocks_noaccess(), VALGRIND_MAKE_MEM_NOACCESS, VALGRIND_MAKE_MEM_UNDEFINED, and virt_to_phys().

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

◆ mdumpfree()

void mdumpfree ( void  )

Dump free block list (for debugging)

Definition at line 718 of file malloc.c.

718  {
719  struct memory_block *block;
720 
721  dbg_printf ( "HEAP free block list:\n" );
722  list_for_each_entry ( block, &free_blocks, list ) {
723  dbg_printf ( "...[%p,%p] (size %#zx)\n", block,
724  ( ( ( void * ) block ) + block->size ),
725  block->size );
726  }
727 }
struct list_head list
List of free blocks.
Definition: malloc.c:59
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:431
A free block of memory.
Definition: malloc.c:44
uint8_t block[3][8]
DES-encrypted blocks.
Definition: mschapv2.h:12
void dbg_printf(const char *fmt,...)
Print debug message.
Definition: debug.c:38

References block, dbg_printf(), memory_block::list, and list_for_each_entry.

◆ 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 43 of file malloc.h.

45  {
46  void * ptr = alloc_memblock ( size, phys_align, offset );
47  if ( ptr && size )
48  VALGRIND_MALLOCLIKE_BLOCK ( ptr, size, 0, 0 );
49  return ptr;
50 }
void *__malloc alloc_memblock(size_t size, size_t align, size_t offset)
Allocate a memory block.
Definition: malloc.c:284
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed)
Definition: valgrind.h:4411
uint16_t offset
Offset to command line.
Definition: bzimage.h:8

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 61 of file malloc.h.

61  {
62  return malloc_phys_offset ( size, phys_align, 0 );
63 }
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:43

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 76 of file malloc.h.

76  {
77  VALGRIND_FREELIKE_BLOCK ( ptr, 0 );
78  free_memblock ( ptr, size );
79 }
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
void free_memblock(void *ptr, size_t size)
Free a memory block.
Definition: malloc.c:416
#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 95 of file malloc.c.

Referenced by alloc_memblock(), and free_memblock().

◆ usedmem

size_t usedmem

Total amount of used memory.

Definition at line 98 of file malloc.c.

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

◆ maxusedmem

size_t maxusedmem

Maximum amount of used memory.

Definition at line 101 of file malloc.c.

Referenced by alloc_memblock(), and shutdown_cache().

◆ __attribute__