Memory management by interfacing C/C++

Paul Backus snarwin at gmail.com
Mon Apr 29 00:53:34 UTC 2019


On Sunday, 28 April 2019 at 23:10:24 UTC, Ferhat Kurtulmuş wrote:
> You are right. I am rewriting the things using mallocs, and 
> will use core.stdc.stdlib.free on d side. I am not sure if I 
> can use core.stdc.stdlib.free to destroy arrays allocated with 
> new op.

core.stdc.stdlib.free is (as the name suggests) the standard C 
`free` function. As such, it can only be used to free memory 
allocated by the standard C functions `malloc`, `calloc`, and 
`realloc`. This is the same in D as it is in C and C++.


More information about the Digitalmars-d-learn mailing list