Dconf 2015 talks...

Era Scarecrow via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 25 12:26:12 PST 2016


On Monday, 25 January 2016 at 17:19:05 UTC, Joseph Rushton 
Wakeling wrote:
> Implementing the random algorithms/other wrappers as a class is 
> problematic because then you get into the hassle of potentially 
> having to new/free a lot of individual heap objects deep in the 
> inner loop of your program.  I already tried this in 
> hap.random, and came to the conclusion that it wasn't a valid 
> approach.

  What about an alternative allocator? Specifically I'm thinking 
in C's equivalent which is alloca (allocates directly on the 
stack with the rest of the variables). If the constructor is a 
function then that won't work; but if it's inlined then it should 
work.

  I suppose the alternate is an option to skip/throw away some 
numbers that should've been consumed (assuming you want to keep 
using the same seed), or seeding each per use.


More information about the Digitalmars-d mailing list