Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OP_METHSTART, OP_INITFIELD: use shared mem for aux
Allocate the aux structure for these two ops using PerlMemShared_malloc() rather then Newx(). OPs (and auxiliary structures) are shared between threads, and there's no guarantee that an OP will be freed by the same thread as the one which created it. Some OSes (Windows IIRC) get upset if memory is malloc()ed and free()d by different threads, since each thread has a separate malloc() pool. Hence we usually use PerlMemShared_malloc()/_free() to allocate such shared structs. These two recently-added ops were just using Newx(). This commit fixes them. No tests failures as far as I'm aware - this is more a theoretical thing where one thread compiles some code, creates a child, then exits. The child lives on, and when the child finally exits, the aux struct is freed to the wrong pool.
- Loading branch information