On Thu, Jan 05, 2023 at 07:49:38PM +0000, DLearner via Digitalmars-d-learn 
wrote:
> Suppose there is a D main program (not marked anywhere with @nogc),
> that _both_
> 
> A: Calls one or more C functions that themselves call malloc/free; and
> also
> B: Calls one or more D functions that themselves call malloc/free via
> `import core.stdc.stdlib;`
> 
> Assuming the malloc/free's are used correctly, does this situation
> risk crashing the D main program?
[...]

core.stdc.stdlib.{malloc,free} *is* the exact same malloc/free that C
uses, it has nothing to do with the GC.  The allocated memory is taken
from the malloc/free part of the heap, which is disjoint from the heap
memory managed by the GC.

So, it should not cause any crashes.


T

-- 
Маленькие детки - маленькие бедки.

Reply via email to