dip1000 and preview in combine to cause extra safety errors

rikki cattermole rikki at cattermole.co.nz
Tue Jun 14 04:40:44 UTC 2022


On 14/06/2022 4:24 PM, forkit wrote:
> So I presume the assertion that stack 'allocation' is faster than heap 
> 'allocation', is based purely on the basis that there are 'a few less' 
> instructions involved in stack allocation.

No.

The stack allocation uses a single mov instruction which is as cheap as 
you can get in terms of instructions.

You are comparing that against a function call which uses linked lists, 
atomics, locks and syscalls. All of which are pretty darn expensive 
individually let alone together.

These two things are in very different categories of costs.

One is practically free, the other is measurable.


More information about the Digitalmars-d mailing list