From d6fa9cd50b9d89b7086eba5601011c167e99f6c1 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Tue, 15 Apr 2025 16:03:12 +0200 Subject: [PATCH] Added some comments about the tracking allocator. --- lib/std/core/allocators/tracking_allocator.c3 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/std/core/allocators/tracking_allocator.c3 b/lib/std/core/allocators/tracking_allocator.c3 index b026df40f..3fe0cb77b 100644 --- a/lib/std/core/allocators/tracking_allocator.c3 +++ b/lib/std/core/allocators/tracking_allocator.c3 @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2024 Christoffer Lerno. All rights reserved. +// Copyright (c) 2021-2025 Christoffer Lerno. All rights reserved. // Use of this source code is governed by the MIT license // a copy of which can be found in the LICENSE_STDLIB file. @@ -18,6 +18,10 @@ alias AllocMap = HashMap { uptr, Allocation }; // A simple tracking allocator. // It tracks allocations using a hash map but // is not compatible with allocators that uses mark() +// +// It is also embarassingly single-threaded, so +// do not use it to track allocations that cross threads. + struct TrackingAllocator (Allocator) { Allocator inner_allocator;