diff --git a/std/experimental/allocator/building_blocks/affix_allocator.d b/std/experimental/allocator/building_blocks/affix_allocator.d index 869c21129..6042fe539 100644 --- a/std/experimental/allocator/building_blocks/affix_allocator.d +++ b/std/experimental/allocator/building_blocks/affix_allocator.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_affix_allocator.d) +*/ module std.experimental.allocator.building_blocks.affix_allocator; /** diff --git a/std/experimental/allocator/building_blocks/allocator_list.d b/std/experimental/allocator/building_blocks/allocator_list.d index 8c00eefdb..1c51469b8 100644 --- a/std/experimental/allocator/building_blocks/allocator_list.d +++ b/std/experimental/allocator/building_blocks/allocator_list.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_allocator_list.d) +*/ module std.experimental.allocator.building_blocks.allocator_list; import std.experimental.allocator.building_blocks.null_allocator; diff --git a/std/experimental/allocator/building_blocks/bitmapped_block.d b/std/experimental/allocator/building_blocks/bitmapped_block.d index e7b2fc825..75318ef84 100644 --- a/std/experimental/allocator/building_blocks/bitmapped_block.d +++ b/std/experimental/allocator/building_blocks/bitmapped_block.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_bitmapped_block.d) +*/ module std.experimental.allocator.building_blocks.bitmapped_block; import std.experimental.allocator.building_blocks.null_allocator; diff --git a/std/experimental/allocator/building_blocks/bucketizer.d b/std/experimental/allocator/building_blocks/bucketizer.d index a182d2d99..567f2f6ca 100644 --- a/std/experimental/allocator/building_blocks/bucketizer.d +++ b/std/experimental/allocator/building_blocks/bucketizer.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_bucketizer.d) +*/ module std.experimental.allocator.building_blocks.bucketizer; /** diff --git a/std/experimental/allocator/building_blocks/fallback_allocator.d b/std/experimental/allocator/building_blocks/fallback_allocator.d index edc5e361e..3af5b7037 100644 --- a/std/experimental/allocator/building_blocks/fallback_allocator.d +++ b/std/experimental/allocator/building_blocks/fallback_allocator.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_fallback_allocator.d) +*/ module std.experimental.allocator.building_blocks.fallback_allocator; import std.experimental.allocator.common; diff --git a/std/experimental/allocator/building_blocks/free_list.d b/std/experimental/allocator/building_blocks/free_list.d index 7defd6258..f0fcee976 100644 --- a/std/experimental/allocator/building_blocks/free_list.d +++ b/std/experimental/allocator/building_blocks/free_list.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_free_list.d) +*/ module std.experimental.allocator.building_blocks.free_list; import std.experimental.allocator.common; diff --git a/std/experimental/allocator/building_blocks/free_tree.d b/std/experimental/allocator/building_blocks/free_tree.d index fc77aab76..1bb3c8ea6 100644 --- a/std/experimental/allocator/building_blocks/free_tree.d +++ b/std/experimental/allocator/building_blocks/free_tree.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_free_tree.d) +*/ module std.experimental.allocator.building_blocks.free_tree; import std.experimental.allocator.common; diff --git a/std/experimental/allocator/building_blocks/kernighan_ritchie.d b/std/experimental/allocator/building_blocks/kernighan_ritchie.d index 26fe6768f..071ad43af 100644 --- a/std/experimental/allocator/building_blocks/kernighan_ritchie.d +++ b/std/experimental/allocator/building_blocks/kernighan_ritchie.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_kernighan_ritchie.d) +*/ module std.experimental.allocator.building_blocks.kernighan_ritchie; import std.experimental.allocator.building_blocks.null_allocator; diff --git a/std/experimental/allocator/building_blocks/null_allocator.d b/std/experimental/allocator/building_blocks/null_allocator.d index e9c56a316..30737a343 100644 --- a/std/experimental/allocator/building_blocks/null_allocator.d +++ b/std/experimental/allocator/building_blocks/null_allocator.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_null_allocator.d) +*/ module std.experimental.allocator.building_blocks.null_allocator; /** diff --git a/std/experimental/allocator/building_blocks/package.d b/std/experimental/allocator/building_blocks/package.d index d55a16b4a..c21276b23 100644 --- a/std/experimental/allocator/building_blocks/package.d +++ b/std/experimental/allocator/building_blocks/package.d @@ -1,3 +1,4 @@ +// Written in the D programming language. /** $(H2 Assembling Your Own Allocator) @@ -280,6 +281,8 @@ $(COMMENT $(TR $(TDC2 InternalPointersTree) $(TD Adds support for resolving inte pointers on top of another allocator.))) ) +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_package.d) + Macros: MYREF2 = $(REF_SHORT $1, std,experimental,allocator,building_blocks,$2) MYREF3 = $(REF_SHORT $1, std,experimental,allocator,$2) diff --git a/std/experimental/allocator/building_blocks/quantizer.d b/std/experimental/allocator/building_blocks/quantizer.d index dc2774811..bdb2506b3 100644 --- a/std/experimental/allocator/building_blocks/quantizer.d +++ b/std/experimental/allocator/building_blocks/quantizer.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_quantizer.d) +*/ module std.experimental.allocator.building_blocks.quantizer; import std.experimental.allocator.common; diff --git a/std/experimental/allocator/building_blocks/region.d b/std/experimental/allocator/building_blocks/region.d index 440c2704e..82e550e3c 100644 --- a/std/experimental/allocator/building_blocks/region.d +++ b/std/experimental/allocator/building_blocks/region.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_region.d) +*/ module std.experimental.allocator.building_blocks.region; import std.experimental.allocator.building_blocks.null_allocator; diff --git a/std/experimental/allocator/building_blocks/scoped_allocator.d b/std/experimental/allocator/building_blocks/scoped_allocator.d index a0212a9a7..4516b83c6 100644 --- a/std/experimental/allocator/building_blocks/scoped_allocator.d +++ b/std/experimental/allocator/building_blocks/scoped_allocator.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_scoped_allocator.d) +*/ module std.experimental.allocator.building_blocks.scoped_allocator; import std.experimental.allocator.common; diff --git a/std/experimental/allocator/building_blocks/segregator.d b/std/experimental/allocator/building_blocks/segregator.d index 71fe2b061..42e71a515 100644 --- a/std/experimental/allocator/building_blocks/segregator.d +++ b/std/experimental/allocator/building_blocks/segregator.d @@ -1,4 +1,7 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_segregator.d) +*/ module std.experimental.allocator.building_blocks.segregator; import std.experimental.allocator.common; diff --git a/std/experimental/allocator/building_blocks/stats_collector.d b/std/experimental/allocator/building_blocks/stats_collector.d index 39e35ac92..483f9baa5 100644 --- a/std/experimental/allocator/building_blocks/stats_collector.d +++ b/std/experimental/allocator/building_blocks/stats_collector.d @@ -4,15 +4,18 @@ Allocator that collects useful statistics about allocations, both global and per calling point. The statistics collected can be configured statically by choosing combinations of `Options` appropriately. -Example: ----- -import std.experimental.allocator.gc_allocator : GCAllocator; -import std.experimental.allocator.building_blocks.free_list : FreeList; -alias Allocator = StatsCollector!(GCAllocator, Options.bytesUsed); ----- +Source: $(PHOBOSSRC std/experimental/allocator/building_blocks/_stats_collector.d) */ module std.experimental.allocator.building_blocks.stats_collector; +/// +@safe unittest +{ + import std.experimental.allocator.gc_allocator : GCAllocator; + import std.experimental.allocator.building_blocks.free_list : FreeList; + alias Allocator = StatsCollector!(GCAllocator, Options.bytesUsed); +} + import std.experimental.allocator.common; /** diff --git a/std/experimental/allocator/common.d b/std/experimental/allocator/common.d index 72698d535..0c4a57541 100644 --- a/std/experimental/allocator/common.d +++ b/std/experimental/allocator/common.d @@ -1,9 +1,12 @@ +// Written in the D programming language. /** Utility and ancillary artifacts of `std.experimental.allocator`. This module shouldn't be used directly; its functionality will be migrated into more appropriate parts of `std`. Authors: $(HTTP erdani.com, Andrei Alexandrescu), Timon Gehr (`Ternary`) + +Source: $(PHOBOSSRC std/experimental/allocator/_common.d) */ module std.experimental.allocator.common; import std.algorithm.comparison, std.traits; diff --git a/std/experimental/allocator/gc_allocator.d b/std/experimental/allocator/gc_allocator.d index cb509c944..7954d10c2 100644 --- a/std/experimental/allocator/gc_allocator.d +++ b/std/experimental/allocator/gc_allocator.d @@ -1,10 +1,15 @@ -/// +// Written in the D programming language. +/** +D's built-in garbage-collected allocator. + +Source: $(PHOBOSSRC std/experimental/allocator/_gc_allocator.d) +*/ module std.experimental.allocator.gc_allocator; import std.experimental.allocator.common; /** D's built-in garbage-collected allocator. - */ +*/ struct GCAllocator { import core.memory : GC; diff --git a/std/experimental/allocator/mallocator.d b/std/experimental/allocator/mallocator.d index e62b9211e..739eb84eb 100644 --- a/std/experimental/allocator/mallocator.d +++ b/std/experimental/allocator/mallocator.d @@ -1,4 +1,9 @@ -/// +// Written in the D programming language. +/** +The C heap allocator. + +Source: $(PHOBOSSRC std/experimental/allocator/_mallocator.d) +*/ module std.experimental.allocator.mallocator; import std.experimental.allocator.common; diff --git a/std/experimental/allocator/mmap_allocator.d b/std/experimental/allocator/mmap_allocator.d index fc94749ef..530ee4159 100644 --- a/std/experimental/allocator/mmap_allocator.d +++ b/std/experimental/allocator/mmap_allocator.d @@ -1,9 +1,10 @@ -/// +// Written in the D programming language. +/** +Source: $(PHOBOSSRC std/experimental/allocator/_mmap_allocator.d) +*/ module std.experimental.allocator.mmap_allocator; -// MmapAllocator /** - Allocator (currently defined only for Posix and Windows) using $(D $(LINK2 https://en.wikipedia.org/wiki/Mmap, mmap)) and $(D $(LUCKY munmap)) directly (or their Windows equivalents). There is no @@ -12,7 +13,6 @@ $(D mmap(null, s, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)), and each call to $(D deallocate(b)) issues $(D munmap(b.ptr, b.length)). So $(D MmapAllocator) is usually intended for allocating large chunks to be managed by fine-granular allocators. - */ struct MmapAllocator { diff --git a/std/experimental/allocator/showcase.d b/std/experimental/allocator/showcase.d index 6985e5dad..709146186 100644 --- a/std/experimental/allocator/showcase.d +++ b/std/experimental/allocator/showcase.d @@ -1,9 +1,10 @@ +// Written in the D programming language. /** - Collection of typical and useful prebuilt allocators using the given components. User code would typically import this module and use its facilities, or import individual heap building blocks and assemble them. +Source: $(PHOBOSSRC std/experimental/allocator/_showcase.d) */ module std.experimental.allocator.showcase; diff --git a/std/experimental/allocator/typed.d b/std/experimental/allocator/typed.d index 92828f387..b68acb907 100644 --- a/std/experimental/allocator/typed.d +++ b/std/experimental/allocator/typed.d @@ -1,3 +1,4 @@ +// Written in the D programming language. /** This module defines `TypedAllocator`, a statically-typed allocator that aggregates multiple untyped allocators and uses them depending on the static @@ -5,6 +6,8 @@ properties of the types allocated. For example, distinct allocators may be used for thread-local vs. thread-shared data, or for fixed-size data (`struct`, `class` objects) vs. resizable data (arrays). +Source: $(PHOBOSSRC std/experimental/allocator/_typed.d) + Macros: T2=$(TR