From 3f194f1c7264945a63b0018b159cc83bd9385c59 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 26 Aug 2024 23:00:55 +0300 Subject: fix memory leaks destroying threads --- include/arch/tcb.h | 2 +- include/kmi/regions.h | 4 ++++ include/kmi/vmem.h | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/arch/tcb.h b/include/arch/tcb.h index b8b0961..f4726ad 100644 --- a/include/arch/tcb.h +++ b/include/arch/tcb.h @@ -32,7 +32,7 @@ void tcb_assign(struct tcb *t); * * @param t Thread whose RPC stack should be set up. */ -void setup_rpc_stack(struct tcb *t); +stat_t setup_rpc_stack(struct tcb *t); /** * Free memory backing rpc stack. diff --git a/include/kmi/regions.h b/include/kmi/regions.h index e612543..5faec0d 100644 --- a/include/kmi/regions.h +++ b/include/kmi/regions.h @@ -155,6 +155,10 @@ vm_t alloc_shared_region(struct mem_region_root *r, size_t size, size_t *actual_size, vmflags_t flags, id_t pid); +vm_t alloc_shared_fixed_region(struct mem_region_root *r, vm_t start, + size_t size, + size_t *actual_size, vmflags_t flags, id_t pid); + /** * Allocate fixed memory region. * Will allocate region that is at least \c size bytes, and includes \c start. diff --git a/include/kmi/vmem.h b/include/kmi/vmem.h index eb46da5..c53f009 100644 --- a/include/kmi/vmem.h +++ b/include/kmi/vmem.h @@ -129,7 +129,8 @@ void destroy_uvmem(struct tcb *r); * the start of \p base, not necessarily the start of the allocation. * If this should be freed, remember to align down to the base page size. */ -vm_t map_fixed_uvmem(struct tcb *r, pm_t base, size_t size, vmflags_t flags); +vm_t map_shared_fixed_uvmem(struct tcb *r, pm_t base, size_t size, + vmflags_t flags); /** * Clone process memory. -- cgit v1.3