ML and contributing to mir

monkyyy crazymonkyyy at gmail.com
Wed Aug 6 20:16:32 UTC 2025


On Wednesday, 6 August 2025 at 20:08:04 UTC, Marc wrote:
> On Wednesday, 6 August 2025 at 19:15:51 UTC, monkyyy wrote:
>> On Wednesday, 6 August 2025 at 17:54:27 UTC, Marc wrote:
>>> the gc is putitng me off as well
>>
>> gc only runs when you allocate; use the same big arrays c++ 
>> would use and youll be fine
>
> Can I allocate and deallocate without triggering the gc? I 
> don’t know how mir uses the gc in the low level but I’m 
> interested in having reference counter pointers, they are 
> essentials for some operations on tensors without copying the 
> data every time.

You can straight up disable it, by compiler flag or at runtime

but more realistically just put stuff on the stack or global 
scope 99% of the time, or if you must do something dynamic make 
sure its allot all at once.

Dont know anything about mir, but I see no reason to think they 
would be unable to be used reasonably; it isnt some functional 
languge with gc's enable linked lists everywhere, you dont have 
to linked list of bools and have your 1 bit be stored by 180ish 
bits and be a cache miss every iteration like a slow language. 
You can put arrays on the stack, you can call malloc, you can 
cast void*'s.

Its a O(c) overhead to have a gc you dont misuse, it will make 
the exe bigger then it should be from the run time.


More information about the Digitalmars-d mailing list