From 314bca3dc19a864c76153bfcd5a58be8c40000f9 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 30 Aug 2024 19:20:21 +0300 Subject: improvements to shared memory handling + Now each shared region is reference counter (technically each region is refernce counted, private regions just have a count of 1). Also, syscalls that touch the TLB get flushed, but should probably look into where else this flushing might be needed. --- src/regions.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/regions.c') diff --git a/src/regions.c b/src/regions.c index d5f431d..2db1a91 100644 --- a/src/regions.c +++ b/src/regions.c @@ -440,6 +440,9 @@ static vm_t __partition_region(struct mem_region_root *r, struct mem_region *m, m->start = start; m->flags = flags; m->pid = pid; + if (m->pid == 0) + m->refcount = 1; + mark_region_used(m->flags); __insert_used_region(r, m); return __addr(start); -- cgit v1.3