diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-12-01 02:05:19 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-12-01 02:05:19 +0200 |
| commit | 131af4eec38752a27e6e56579fbf76178e022ec1 (patch) | |
| tree | 1940634f69a44395fc6945b25c5cbc8b68bba876 /common/vmem.c | |
| parent | e25f1e7a8f8f2320546ad4950464713d85b47785 (diff) | |
| download | kmi-131af4eec38752a27e6e56579fbf76178e022ec1.tar.gz kmi-131af4eec38752a27e6e56579fbf76178e022ec1.zip | |
start looking into memory handling
+ Now 10M alloc/frees succeed, which totals more memory than the virtual
machine has, so no too obvious leaks are occuring. For future
debugging speed, changed 10M to 1M.
+ Also quick fix to rpcs, stacks are now assigned. Not entirely sure why
they worked before this, but good that I found it.
Diffstat (limited to 'common/vmem.c')
| -rw-r--r-- | common/vmem.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/vmem.c b/common/vmem.c index 56bc01a..a53ce6c 100644 --- a/common/vmem.c +++ b/common/vmem.c @@ -58,8 +58,10 @@ static stat_t __clone_mapped_region(struct tcb *d, struct tcb *s, static stat_t __free_mapped_region(struct tcb *t, struct mem_region *m) { stat_t status = OK; - pm_t pa = __addr(m->end - m->start); - if (unmap_freed_region(t->proc.vmem, m->start, pa, m->flags, &status)) + pm_t start = __addr(m->start); + pm_t end = __addr(m->end); + if (!unmap_freed_region(t->proc.vmem, start, end - start, m->flags, + &status)) return ERR_MISC; return status; @@ -196,13 +198,11 @@ stat_t free_uvmem(struct tcb *r, vm_t va) if (!m) return ERR_NF; - free_region(&r->sp_r, va); - stat_t status = __free_mapped_region(r, m); if (is_rpc(r) && status == INFO_SEFF) return clone_rpc_maps(r); - return status; + return free_known_region(&r->sp_r, m); } stat_t alloc_uvmem_wrapper(struct vmem *b, pm_t *offset, vm_t vaddr, |
