#include <debug.h>
#include <stddef.h>
Go to the source code of this file.
Functions | |
void | malloc_init (void) |
void * | malloc (size_t) __attribute__((malloc)) |
void * | calloc (size_t, size_t) __attribute__((malloc)) |
void * | realloc (void *, size_t) |
void | free (void *) |
Definition at line 160 of file malloc.c.
References malloc(), memset(), NULL, and block::size.
Referenced by dir_open(), file_open(), and inode_create().
void free | ( | void * | ) |
Definition at line 220 of file malloc.c.
References arena_to_block(), ASSERT, desc::block_size, block_to_arena(), desc::blocks_per_arena, arena::desc, arena::free_cnt, block::free_elem, desc::free_list, list_push_front(), list_remove(), desc::lock, lock_acquire(), lock_release(), memset(), NULL, palloc_free_multiple(), and palloc_free_page().
Referenced by bitmap_create(), bitmap_destroy(), dir_close(), dir_open(), file_close(), file_open(), fsutil_append(), fsutil_extract(), hash_destroy(), inode_close(), inode_create(), inode_read_at(), inode_write_at(), pci_setup_io(), read_partition_table(), realloc(), rehash(), test_sleep(), uhci_destroy_chan(), uhci_destroy_info(), and uhci_remove_eop().
void* malloc | ( | size_t | ) |
Definition at line 91 of file malloc.c.
References ARENA_MAGIC, arena_to_block(), desc::block_size, block_to_arena(), desc::blocks_per_arena, arena::desc, desc_cnt, descs, DIV_ROUND_UP, arena::free_cnt, block::free_elem, desc::free_list, list_empty(), list_entry, list_pop_front(), list_push_back(), desc::lock, lock_acquire(), lock_release(), arena::magic, NULL, palloc_get_multiple(), palloc_get_page(), and PGSIZE.
Referenced by bitmap_create(), block_register(), calloc(), found_partition(), fsutil_append(), fsutil_extract(), hash_init(), inode_open(), inode_read_at(), inode_write_at(), msc_attached(), pci_probe(), pci_setup_io(), read_partition_table(), realloc(), rehash(), test_priority_fifo(), test_sleep(), uhci_create_chan(), uhci_create_eop(), uhci_create_info(), usb_configure_default(), usb_get_string(), usb_load_config(), usb_register_class(), and usb_register_host().
void malloc_init | ( | void | ) |
Definition at line 73 of file malloc.c.
References ASSERT, desc::block_size, block_size(), desc::blocks_per_arena, desc_cnt, descs, desc::free_list, list_init(), desc::lock, lock_init(), and PGSIZE.
Referenced by main().
void* realloc | ( | void * | , | |
size_t | ||||
) |