Skip to content

Commit 108b3c5

Browse files
author
Felix "xq" Queißner
committed
Improves the comment formatting.
1 parent e28f4a1 commit 108b3c5

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

lib/std/heap.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ pub const MemoryPoolOptions = memory_pool.Options;
2929
/// TODO Utilize this on Windows.
3030
pub var next_mmap_addr_hint: ?[*]align(mem.page_size) u8 = null;
3131

32-
3332
const CAllocator = struct {
3433
comptime {
3534
if (!builtin.link_libc) {

lib/std/heap/memory_pool.zig

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ const debug_mode = @import("builtin").mode == .Debug;
55
pub const MemoryPoolError = error{OutOfMemory};
66

77
/// A memory pool that can allocate objects of a single type very quickly.
8-
/// Use this instead of a general purpose allocator when you need to allocate a lot of objects
9-
/// of the same type, as a memory pool outperforms general purpose allocators.
8+
/// Use this when you need to allocate a lot of objects of the same type,
9+
/// because It outperforms general purpose allocators.
1010
pub fn MemoryPool(comptime Item: type) type {
1111
return MemoryPoolAligned(Item, @alignOf(Item));
1212
}
1313

1414
/// A memory pool that can allocate objects of a single type very quickly.
15-
/// Use this instead of a general purpose allocator when you need to allocate a lot of objects
16-
/// of the same type, as a memory pool outperforms general purpose allocators.
15+
/// Use this when you need to allocate a lot of objects of the same type,
16+
/// because It outperforms general purpose allocators.
1717
pub fn MemoryPoolAligned(comptime Item: type, comptime alignment: u29) type {
1818
if (@alignOf(Item) == alignment) {
1919
return MemoryPoolExtra(Item, .{});
@@ -32,20 +32,18 @@ pub const Options = struct {
3232
};
3333

3434
/// A memory pool that can allocate objects of a single type very quickly.
35-
/// Use this instead of a general purpose allocator when you need to allocate a lot of objects
36-
/// of the same type, as a memory pool outperforms general purpose allocators.
35+
/// Use this when you need to allocate a lot of objects of the same type,
36+
/// because It outperforms general purpose allocators.
3737
pub fn MemoryPoolExtra(comptime Item: type, comptime pool_options: Options) type {
3838
return struct {
3939
const Pool = @This();
4040

41-
/// Size of the memory pool items. This is not necessarily
42-
/// the same as `@sizeOf(Item)` as the pool also uses the items for internal
43-
/// means.
41+
/// Size of the memory pool items. This is not necessarily the same
42+
/// as `@sizeOf(Item)` as the pool also uses the items for internal means.
4443
pub const item_size = std.math.max(@sizeOf(Node), @sizeOf(Item));
4544

46-
/// Alignment of the memory pool items. This is not necessarily
47-
/// the same as `@alignOf(Item)` as the pool also uses the items for internal
48-
/// means.
45+
/// Alignment of the memory pool items. This is not necessarily the same
46+
/// as `@alignOf(Item)` as the pool also uses the items for internal means.
4947
pub const item_alignment = std.math.max(@alignOf(Node), pool_options.alignment orelse 0);
5048

5149
const Node = struct {

0 commit comments

Comments
 (0)