Re: GC interaction with malloc/free

2023-01-05 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 05, 2023 at 08:18:42PM +, DLearner via Digitalmars-d-learn wrote: > On Thursday, 5 January 2023 at 19:54:01 UTC, H. S. Teoh wrote: [...] > > 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 >

Re: GC interaction with malloc/free

2023-01-05 Thread DLearner via Digitalmars-d-learn
On Thursday, 5 January 2023 at 19:54:01 UTC, H. S. Teoh wrote: On Thu, Jan 05, 2023 at 07:49:38PM +, 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; a

Re: GC interaction with malloc/free

2023-01-05 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 05, 2023 at 07:49:38PM +, 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 themselve

GC interaction with malloc/free

2023-01-05 Thread DLearner via Digitalmars-d-learn
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 cor