On Thursday, 5 January 2017 at 11:09:01 UTC, xtreak wrote:
I am newbie to D learning it for sometime using Ali's book. I came across std.experimental.allocator and read through http://dlang.org/library/std/experimental/allocator/building_blocks.html . Can someone explain me the actual benefits of using this and if so any benchmarks explaining the advantage. Maybe its too advanced for me as a beginner now its just I am curious over the usage and applications with a simple hello world like example explaining what this library will accomplish. I asked it previously at https://www.reddit.com/r/programming/comments/4hti33/dconf_2016_is_streaming_right_now/d2satic/ but still I don't understand the exact applications of the same.

A simple hello world like example over its advantage will be very much helpful.

PS : Sorry for the crosspost. I posted it to learn group but didn't receive any suggestions on the same at http://forum.dlang.org/post/[email protected]

I also have found std.experimental.allocator's documentation is written at quite the advanced level. There is definitely scope for someone to improve it (for instance, the main page presupposes that the reader already knows what allocators are) or write a nice tutorial.

Nevertheless, the building blocks page is actually about how to build your own allocator. You can use std.experimental.allocator without building your own. The page
https://dlang.org/phobos/std_experimental_allocator.html
actually has some very simple examples on how to allocate an int or an array and dispose of them.

You might also consider reviewing the following threads
http://forum.dlang.org/post/[email protected]
http://forum.dlang.org/post/[email protected]

Reply via email to