Allocating memory from library

Temtaime temtaime at gmail.com
Sat Mar 8 11:31:16 PST 2014


Hi !
I just wondered if this code is valid:

void main() {
auto p = my_allocate();

// ...

my_free(p);
}

extern(System):

void *my_allocate();
void my_free(void *);

Where my_allocate and my_free are in the external dll. Main 
question is: is this code transparent to GC? Will not it try to 
collect memory which is pointed by p after my_free?

Thanks!


More information about the Digitalmars-d-learn mailing list