#include <heap.hpp>
Metody publiczne | |
void | unAnchorBlock (block_free *item) |
int | take_block (block_free *item, uint32 facility, int(*destruct)(class heapbox *, void *)) |
addr_t | morecor (uint32 cnt, bool alloc_pgs) |
int | knew_used (void *ptr, uint32 size, uint32 facility, int(destructor)(class heapbox *, void *)) |
block_free * | klastfree () |
uint32 | blsize (char *ptr) |
block_used * | kget_info (void *ptr) |
void | kdefragment (void *ptr) |
int | resize_used_blocks_table () |
void * | mallocFuncPr (size_t size, size_t alignment, uint32 facility, int(*destruct)(class heapbox *, void *), uint32 MallocState) |
void * | mallocFunc (size_t size, size_t alignment, uint32 facility, int(*destruct)(class heapbox *, void *), uint32 MallocState) |
int | freeFuncPr (void *ptr, uint32 FreeState) |
int | freeFunc (void *ptr, uint32 FreeState) |
int | freeFunc2 (void *ptr, uint32 FreeState) |
int | freeFuncPr2 (void *ptr, uint32 FreeState) |
heapbox () | |
void | init (block_used *usd, size_t max_blcks, block_free *fir, const char *nam) |
void | destruct () |
void * | malloc (size_t size, size_t alignment, uint32 facility, int(*destruct)(class heapbox *, void *)) |
void * | malloc (size_t size, size_t alignment, const char *name, int(*destruct)(class heapbox *, void *)) |
int | free (void *ptr) |
uint32 | allocated_count () |
void | unAnchorBlock (block_free *item) |
void | take_block (block_free *item, uint32 facility, int(*destruct)(class heapbox *, void *)) |
addr_t | morecor (uint32 cnt, uint32 alloc_pgs) |
int | knew_used (void *ptr, uint32 size, uint32 facility, int(destructor)(class heapbox *, void *)) |
block_free * | klastfree () |
uint32 | blsize (char *ptr) |
block_used * | kget_info (void *ptr) |
void | kdefragment (void *ptr) |
int | resize_used_blocks_table () |
void * | mallocFunc (size_t size, size_t alignment, uint32 facility, int(*destruct)(class heapbox *, void *), uint32 MallocState) |
int | freeFunc (void *ptr, uint32 FreeState) |
heapbox () | |
void | init (block_used *usd, size_t max_blcks, block_free *fir, char *nam) |
void | destruct () |
void * | malloc (size_t size, size_t alignment, uint32 facility, int(*destruct)(class heapbox *, void *)) |
void * | malloc (size_t size, size_t alignment, const char *name, int(*destruct)(class heapbox *, void *)) |
int | free (void *ptr) |
uint32 | allocated_count () |
Atrybuty publiczne | |
class blist_t | VirtAddrs |
block_used * | used |
uint32 | begin_search |
size_t | max_blocks |
block_free * | first |
bool volatile | NowResizingUsed |
IPC::Lock::lock_t | lock_heap |
struct { | |
uint32 volatile allocs | |
uint32 volatile max | |
uint32 volatile used | |
} | stats |
char | name [HEAPBOX_NAME] |
uint32 | heapbox_no |
struct blist_s * | morecor_new_node |
uint32 volatile | NowResizingUsed |
struct { | |
uint32 volatile allocs | |
uint32 volatile max | |
uint32 volatile used | |
} | stats |
Definicja w linii 108 pliku heap.hpp.
Memory::Heap::heapbox::heapbox | ( | ) |
Memory::Heap::heapbox::heapbox | ( | ) |
void Memory::Heap::heapbox::unAnchorBlock | ( | block_free * | item | ) |
Definicja w linii 342 pliku heap.cpp.
Odwołuje się do Memory::Heap::countMagic(), first, Memory::Heap::HEAP_GRAN, Memory::Pager::lazy_enable, morecor(), blist_s::next, NULL i blist_s::prev.
int Memory::Heap::heapbox::take_block | ( | block_free * | item, | |
uint32 | facility, | |||
int(*)(class heapbox *, void *) | destruct | |||
) |
Odwołania w mallocFuncPr().
przydziel fizyczne i liniowe strony pamieci dla tej sterty
Definicja w linii 454 pliku heap.cpp.
Odwołuje się do Memory::zone::alloc(), alloc4k(), Memory::Heap::countMagic(), blist_s::data, ESUCCESS, blist_s::file, first, blist_s::func, Memory::Heap::HEAP_STACK_GRAN, kdefragment(), Memory::Pager::kmem, blist_s::line, blist_t::link(), memset(), morecor_new_node, Memory::Heap::block_free::next, null, NULL, PAGE_SIZE, Arch::x86::Interr::pr(), Memory::Heap::block_free::prev, PTE_PRESENT, PTE_WRITEABLE, Memory::Heap::block_free::size, blist_s::size, stats, blist_s::tree, VirtAddrs, Memory::Heap::virtual_pages i PRNG::x.
Odwołania w mallocFuncPr() i unAnchorBlock().
int Memory::Heap::heapbox::knew_used | ( | void * | ptr, | |
uint32 | size, | |||
uint32 | facility, | |||
int(destructor)(class heapbox *, void *) | ||||
) |
block_free * Memory::Heap::heapbox::klastfree | ( | ) |
Definicja w linii 872 pliku heap.cpp.
Odwołuje się do first.
Odwołania w freeFuncPr() i freeFuncPr2().
uint32 Memory::Heap::heapbox::blsize | ( | char * | ptr | ) |
block_used * Memory::Heap::heapbox::kget_info | ( | void * | ptr | ) |
Definicja w linii 823 pliku heap.cpp.
Odwołuje się do Memory::Heap::block_prolog::check, complain, heapbox_no, max_blocks, null, NULL, Memory::Heap::block_prolog::ov, Arch::x86::Interr::pr(), Memory::Heap::PROLOG_CHECKSUM, sysfail i used.
Odwołania w blsize(), freeFunc(), freeFuncPr(), freeFuncPr2(), mallocFunc(), mallocFuncPr() i resize_used_blocks_table().
void Memory::Heap::heapbox::kdefragment | ( | void * | ptr | ) |
Definicja w linii 1143 pliku heap.cpp.
Odwołuje się do Memory::Heap::countMagic().
Odwołania w freeFuncPr(), freeFuncPr2() i morecor().
int Memory::Heap::heapbox::resize_used_blocks_table | ( | ) |
Definicja w linii 1184 pliku heap.cpp.
Odwołuje się do assert, complain, debug_dump_call_trace(), destruct(), EINVAL, ESUCCESS, FAC_MEMORY, FAC_USEDBLOCKS, freeFunc(), freeze, Memory::Heap::HEAP_TBLE_GRAN, kget_info(), Memory::Heap::MALLOC_NOLOCKS, Memory::Heap::MALLOC_NORESCUE, mallocFunc(), max_blocks, memmove(), memset(), null, NULL, STACK_ALIGN, stats i used.
Odwołania w mallocFuncPr().
void * Memory::Heap::heapbox::mallocFuncPr | ( | size_t | size, | |
size_t | alignment, | |||
uint32 | facility, | |||
int(*)(class heapbox *, void *) | destruct, | |||
uint32 | MallocState | |||
) |
Definicja w linii 569 pliku heap.cpp.
Odwołuje się do align_up(), assert, Memory::Heap::can_be_aligned(), Memory::Heap::block_prolog::check, Memory::Heap::checkMagic(), complain, destruct(), EINVAL, first, freeze, Memory::Heap::HEAP_GRAN, Memory::Heap::HEAP_MIN_BLOCK, Memory::Heap::HEAP_STACK_GRAN, heapbox_no, kget_info(), Memory::Pager::lazy_enable, IPC::Lock::lock_t::lock(), lock_heap, Memory::Heap::MALLOC_NOLOCKS, Memory::Heap::MALLOC_NORESCUE, max_blocks, morecor(), Memory::Heap::new_bl_bl(), Memory::Heap::block_free::next, NowResizingUsed, null, Memory::Heap::block_prolog::ov, Memory::Heap::PROLOG_CHECKSUM, resize_used_blocks_table(), Memory::Heap::block_free::size, stats, take_block(), IPC::Lock::lock_t::ulock() i used.
Odwołania w mallocFunc().
void * Memory::Heap::heapbox::mallocFunc | ( | size_t | size, | |
size_t | alignment, | |||
uint32 | facility, | |||
int(*)(class heapbox *, void *) | destruct, | |||
uint32 | MallocState | |||
) |
Definicja w linii 518 pliku heap.cpp.
Odwołuje się do assert, complain, destruct(), freeze, kget_info(), Memory::Heap::MALLOC_MORECOR_NEW_NODE, Memory::Heap::MALLOC_NORESCUE, mallocFuncPr(), morecor_new_node, NO_ALIGN, NULL, null i used.
Odwołania w Memory::Heap::allocate_heapbox(), malloc() i resize_used_blocks_table().
int Memory::Heap::heapbox::freeFuncPr | ( | void * | ptr, | |
uint32 | FreeState | |||
) |
Definicja w linii 1014 pliku heap.cpp.
Odwołuje się do begin_search, complain, Memory::Heap::countMagic(), destruct(), Memory::Heap::block_used::destruct, EINVAL, ESUCCESS, first, kdefragment(), kget_info(), klastfree(), IPC::Lock::lock_t::lock(), lock_heap, Memory::Heap::MALLOC_NOLOCKS, NULL, null, sbg, Memory::Heap::block_used::size, stats, IPC::Lock::lock_t::ulock() i used.
Odwołania w freeFunc().
int Memory::Heap::heapbox::freeFunc | ( | void * | ptr, | |
uint32 | FreeState | |||
) |
FreeState may be 0 or MALLOC_NOLOCKS. In the former, the heap is locked on during operation. free block; points to data part
Definicja w linii 986 pliku heap.cpp.
Odwołuje się do assert, complain, destruct(), freeFuncPr(), freeze, kget_info(), null i used.
Odwołania w free() i resize_used_blocks_table().
int Memory::Heap::heapbox::freeFunc2 | ( | void * | ptr, | |
uint32 | FreeState | |||
) |
Definicja w linii 882 pliku heap.cpp.
Odwołuje się do complain, freeFuncPr2(), freeze i null.
Odwołania w Collection::AvlTree< Collection::Tuple2< KeyT, DataT >, tuple2_comparator< KeyT, DataT, cmp > >::remove2() i Collection::AvlTree< Collection::Tuple2< KeyT, DataT >, tuple2_comparator< KeyT, DataT, cmp > >::removeMin2().
int Memory::Heap::heapbox::freeFuncPr2 | ( | void * | ptr, | |
uint32 | FreeState | |||
) |
Definicja w linii 889 pliku heap.cpp.
Odwołuje się do begin_search, Memory::Heap::countMagic(), destruct(), Memory::Heap::block_used::destruct, EINVAL, ESUCCESS, first, kdefragment(), kget_info(), klastfree(), lnDbg, null, NULL, Memory::Heap::block_used::size, stats i used.
Odwołania w freeFunc2().
void Memory::Heap::heapbox::init | ( | block_used * | usd, | |
size_t | max_blcks, | |||
block_free * | fir, | |||
const char * | nam | |||
) |
Definicja w linii 252 pliku heap.cpp.
Odwołuje się do first, Memory::Heap::HEAPBOX_NAME, heapbox_no, IPC::Lock::lock_t::init(), lgth(), lock_heap, max_blocks, memmove(), memset(), MIN, name i used.
Odwołania w Memory::Heap::allocate_heapbox().
void Memory::Heap::heapbox::destruct | ( | ) |
Definicja w linii 266 pliku heap.cpp.
Odwołuje się do blist_s::data, blist_t::del(), Memory::Heap::block_used::destruct, disalloc4k(), blist_t::done(), blist_t::find(), Memory::zone::free(), blist_t::head, Memory::Heap::HEAP_STACK_GRAN, Memory::Heap::HeapList, Thread::i, Memory::Pager::kmem, max_blocks, blist_s::next, PAGE_SIZE, PTE_PRESENT, used, VirtAddrs i Memory::Heap::virtual_pages.
Odwołania w freeFunc(), freeFuncPr(), freeFuncPr2(), malloc(), mallocFunc(), mallocFuncPr(), Thread::ProcFinishOff() i resize_used_blocks_table().
void * Memory::Heap::heapbox::malloc | ( | size_t | size, | |
size_t | alignment, | |||
uint32 | facility, | |||
int(*)(class heapbox *, void *) | destruct | |||
) |
allocate memory. aligns up the requested size to HEAP_MIN_BLOCK, min block size HEAP. Malloc will find a chunk of memory aligned as size_t alignment. Facility is build of FAC_* consts or'ed, or a pointer to a const char *. It is advisable that in the first case the value is less than 0xc000_0000 and the other, that the pointer is above 0xc000_0000. MallocState tells malloc to function as said: const uint32 MALLOC_NORESCUE = 1; // this means mallocFunc() is being called from resize_used_blocks_table() and it should not attempt to resize the table (which, probably has only one left entry) const uint32 MALLOC_NOLOCKS = 2; // mallocFunc() will not lock, or ulock the heap entity. This is useful for recursive malloc()ing, which happens if memory is insufficient and a morecor() is called.
Definicja w linii 806 pliku heap.cpp.
Odwołuje się do _PF, destruct(), mallocFunc() i Preturn.
Odwołania w Thread::Timer::add(), blist_t::add(), Thread::process_t::alloc_stack(), Memory::Pager::allocate_memtree(), Net::Arp::arp_get_ether(), blistsort_add(), blistsort_ptr(), Module::init(), Collection::Mem::kmalloc(), malloc(), Net::pbuf_alloc() i blist_t::ptr().
int Memory::Heap::heapbox::free | ( | void * | ptr | ) |
Definicja w linii 1124 pliku heap.cpp.
Odwołuje się do freeFunc().
Odwołania w Thread::Timer::add(), blist_t::add(), Net::Arp::arp_request_timer(), blistsort_add(), blist_t::del(), mmap_t::done(), Collection::Mem::kfree(), Net::pbuf_free(), Thread::Timer::remove() i Thread::Timer::TimerThread().
void Memory::Heap::heapbox::unAnchorBlock | ( | block_free * | item | ) |
void Memory::Heap::heapbox::take_block | ( | block_free * | item, | |
uint32 | facility, | |||
int(*)(class heapbox *, void *) | destruct | |||
) |
int Memory::Heap::heapbox::knew_used | ( | void * | ptr, | |
uint32 | size, | |||
uint32 | facility, | |||
int(destructor)(class heapbox *, void *) | ||||
) |
block_free* Memory::Heap::heapbox::klastfree | ( | ) |
uint32 Memory::Heap::heapbox::blsize | ( | char * | ptr | ) |
block_used* Memory::Heap::heapbox::kget_info | ( | void * | ptr | ) |
void Memory::Heap::heapbox::kdefragment | ( | void * | ptr | ) |
int Memory::Heap::heapbox::resize_used_blocks_table | ( | ) |
void* Memory::Heap::heapbox::mallocFunc | ( | size_t | size, | |
size_t | alignment, | |||
uint32 | facility, | |||
int(*)(class heapbox *, void *) | destruct, | |||
uint32 | MallocState | |||
) |
int Memory::Heap::heapbox::freeFunc | ( | void * | ptr, | |
uint32 | FreeState | |||
) |
void Memory::Heap::heapbox::init | ( | block_used * | usd, | |
size_t | max_blcks, | |||
block_free * | fir, | |||
char * | nam | |||
) |
void Memory::Heap::heapbox::destruct | ( | ) |
void* Memory::Heap::heapbox::malloc | ( | size_t | size, | |
size_t | alignment, | |||
uint32 | facility, | |||
int(*)(class heapbox *, void *) | destruct | |||
) |
void* Memory::Heap::heapbox::malloc | ( | size_t | size, | |
size_t | alignment, | |||
const char * | name, | |||
int(*)(class heapbox *, void *) | destruct | |||
) |
int Memory::Heap::heapbox::free | ( | void * | ptr | ) |
uint32 Memory::Heap::heapbox::allocated_count | ( | ) |
Definicja w linii 112 pliku heap.hpp.
Odwołania w Memory::Heap::allocate_heapbox(), destruct() i morecor().
Definicja w linii 113 pliku heap.hpp.
Odwołania w Memory::Heap::allocate_heapbox(), debug_heap_stats(), destruct(), freeFunc(), freeFuncPr(), freeFuncPr2(), init(), kget_info(), mallocFunc(), mallocFuncPr(), resize_used_blocks_table() i VarieteThread().
Definicja w linii 115 pliku heap.hpp.
Odwołania w destruct(), init(), kget_info(), mallocFuncPr(), resize_used_blocks_table() i VarieteThread().
Definicja w linii 116 pliku heap.hpp.
Odwołania w debug_heap_stats(), freeFuncPr(), freeFuncPr2(), init(), klastfree(), mallocFuncPr(), morecor() i unAnchorBlock().
bool volatile Memory::Heap::heapbox::NowResizingUsed |
uint32 volatile Memory::Heap::heapbox::allocs |
uint32 volatile Memory::Heap::heapbox::max |
Definicja w linii 121 pliku heap.hpp.
Odwołania w Memory::Heap::allocate_heapbox() i debug_heap_stats().
uint32 volatile Memory::Heap::heapbox::used |
struct { ... } Memory::Heap::heapbox::stats |
Definicja w linii 125 pliku heap.hpp.
Odwołania w Memory::Heap::allocate_heapbox(), init(), kget_info() i mallocFuncPr().
struct blist_s* Memory::Heap::heapbox::morecor_new_node [read] |
Definicja w linii 126 pliku heap.hpp.
Odwołania w Memory::Heap::allocate_heapbox(), mallocFunc() i morecor().
Definicja w linii 665 pliku ip.old.2.cpp.
struct { ... } Memory::Heap::heapbox::stats |