Phobos addition formal review: std.experimental.allocator

Baz via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 12 15:28:34 PDT 2015


On Friday, 12 June 2015 at 19:19:55 UTC, Andrei Alexandrescu 
wrote:
> On 6/12/15 11:23 AM, Baz wrote:
>> On Friday, 12 June 2015 at 11:09:01 UTC, Dicebot wrote:
>>> Small tip for reviewers: there are quite many modules in 
>>> proposed
>>> package but majority is actual allocator implementation. I'd 
>>> suggest
>>> to start investigating sources/documentation starting from
>>> http://erdani.com/d/phobos-prerelease/std_experimental_allocator.html
>>> and
>>> http://erdani.com/d/phobos-prerelease/std_experimental_allocator_building_blocks.html
>>> while using
>>> http://erdani.com/d/phobos-prerelease/std_experimental_allocator_showcase.html
>>> as reference for "highlight" examples.
>>
>> while building the package as a static lic library, i've found 
>> that
>> _showcase.d_ is not usable under Windows because MmapAllocator 
>> is Posix
>> only:
>>
>> https://github.com/andralex/phobos/blob/allocator/std/experimental/allocator/showcase.d#L66
>>
>> https://github.com/andralex/phobos/blob/allocator/std/experimental/allocator/mmap_allocator.d#L14
>
> I've asked this a while ago as well - could anyone with a 
> Windows rig contribute a MmapAllocator for Windows? Thanks! -- 
> Andrei

I have done it 
(https://gist.github.com/BBasile/e382be91dcc18e4d2358),
but if i run the tests of the showcase i get:

---
...\region.d(84): Error: shared method 
std.experimental.allocator.mmap_allocator.MmapAllocator.allocate 
is not callable using a non-shared object
...\showcase.d(73): Error: template instance 
std.experimental.allocator.region.Region!(MmapAllocator, 8u, 
cast(Flag)false) error instantiating
...\allocator_list.d(76): Error: struct Factory does not overload 
()
...\showcase.d(79): Error: template instance 
std.experimental.allocator.allocator_list.AllocatorList!(Factory, 
NullAllocator) error instantiating
...\region.d(84,29): Error: shared method 
std.experimental.allocator.mmap_allocator.MmapAllocator.allocate 
is not callable using a non-shared object
...\showcase.d(73,20): Error: template instance 
std.experimental.allocator.region.Region!(MmapAllocator, 8u, 
cast(Flag)false) error instantiating
...\allocator_list.d(76,42): Error: struct Factory does not 
overload ()
...\showcase.d(79,12): Error: template instance 
std.experimental.allocator.allocator_list.AllocatorList!(Factory, 
NullAllocator) error instantiating
C:\...\allocator\showcase.d has not been compiled
---

Should i continue and propose a PR ?




More information about the Digitalmars-d mailing list