[fpc-pascal] Multiple thread heaps

Sven Barth pascaldragon at googlemail.com
Sun Jun 17 09:44:52 CEST 2018


Terry Mead <tlm at weighbatch.com> schrieb am So., 17. Juni 2018, 07:45:

> If the default memory manager for FP creates a heap for each thread, what
> happens if an object is created in one thread and freed by another ?
>

If I remember correctly the memory becomes part of the thread's free list
that freed the memory. (Though I could be wrong here)

Also, do calls to New () allocate space on the thread heap or just
> allocated by the OS ?
>

All Pascal memory functions are handled by the heap manager. So yes, it's
the thread's heap.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180617/bec44eeb/attachment.html>


More information about the fpc-pascal mailing list