Classes on stack

Redwan rdwnsjjd at gmail.com
Thu Sep 1 10:13:17 UTC 2022


On Thursday, 1 September 2022 at 09:53:08 UTC, Dennis wrote:
> On Thursday, 1 September 2022 at 09:43:55 UTC, Redwan wrote:
>> oh, thank you. with this, no allocation??
>
> No heap allocation. The `@nogc` attribute is enforced by the 
> compiler, so you will get an error if you use `new` without 
> `scope` here.


OK tnx. another problem that probably is related to this issue.
I compiled this worthless code:
```
void main() {}
```

also this one:
```
@nogc void main() {}
```


the valgrind result:
```
...
total heap usage: 143 alloc, 141 frees, 13,236 bytes allocated
...
```

!!!
what's this means??
from where comes this allocations and also leaks???

if it's for GC, how to completely disable gc? I don't Wan use it 
at all. I searched for a compiler command line disabling for gc 
but not found. GC.disable() is ugly way I think.





More information about the Digitalmars-d mailing list