Changed the way the stores commit their memory: there is no special handling

for temporary memory anymore, it's the store's responsibility to do that
correctly now, and that functionality is reached via the vm_cache using
vm_cache_set_minimal_commitment().
Therefore, the vm_store commit() function now returns a status instead of
the size that could be commited.
Replaced the max_commit mechanism with one that cares about the available
memory, stores can reserve and unreserve such memory. The anonymous_commit()
will now fail in case it could not reserve the needed amount of memory.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9777 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-11-03 17:24:41 +00:00
parent 1583190bd8
commit ba44a1e8e1
12 changed files with 120 additions and 122 deletions
+4 -7
View File
@@ -37,18 +37,15 @@
#define PAGE_PRESENT 256
// Should only be used by vm internals
int vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite, bool isUser, addr_t *newip);
void vm_increase_max_commit(addr_t delta);
int vm_daemon_init(void);
status_t vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite, bool isUser, addr_t *newip);
void vm_unreserve_memory(size_t bytes);
status_t vm_try_reserve_memory(size_t bytes);
status_t vm_daemon_init(void);
// used by the page daemon to walk the list of address spaces
int vm_aspace_walk_start(struct hash_iterator *i);
vm_address_space *vm_aspace_walk_next(struct hash_iterator *i);
// get some data about the number of pages in the system
addr_t vm_page_num_pages(void);
addr_t vm_page_num_free_pages(void);
// allocates memory from the kernel_args structure
addr_t vm_alloc_from_kernel_args(kernel_args *args, size_t size, uint32 lock);