Reputation: 5069
I have a C program with perl running as a thread. I would like to restrict the perl interpreter to use memory from a chunk that I pre-allocated (about 2GB). Wonder if it's possible and how to do it.
Thanks.
Upvotes: 4
Views: 149
Reputation:
I'm reasonably certain there is no way to do that in a normal Perl binary, but all perl's memory allocation code is nicely packaged in the malloc.c
file in the source code. That file also has lots of comments on how Perl's memory allocation works under the hood. It's shouldn't be too hard to create a locally modified perl that does what you want, I think.
Upvotes: 2