Skip to content

Conversation

YakoYakoYokuYoku
Copy link

Previously when using system gd there was no way to use the Zend allocator methods to limit its memory usage.
This PR fixes this by using the new memory allocator setters in libgd/libgd#692. Also, this PR gives the possibility to unbundle ext/gd/libgd.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @YakoYakoYokuYoku!

@devnexen
Copy link
Member

I definitively like your suggestion, let's see what @kocsismate think of it.

@cmb69
Copy link
Member

cmb69 commented Jul 19, 2024

Thank you for the PR, @YakoYakoYokuYoku! This is certainly nice to have, but I guess we need to wait for libgd/libgd#692 to be merged (and probably until it gets released).

Also, this PR gives the possibility to unbundle ext/gd/libgd.

While I, personally, would like to do this as soon as possible, we can only do this for a new major or minor PHP release, and I'm afraid it's way too late for PHP 8.4. At least for the Windows builds, we would need a libgd version which supports the custom allocators, and users of other platforms who build against the bundled libgd would need to be informed of that in advance. And of course, unbundling libgd would need an RFC.

@YakoYakoYokuYoku
Copy link
Author

No worries as I'm not in a hurry, in fact said PR was long accepted. Happens that it hasn't been merged because we detected an error during testing. I've fixed it since then but the upstream maintainers are ignoring it, I don't know why, perhaps it's due to work I guess. To be fair it went off my radar, though I hope it gets merged anytime soon.

At least for the Windows builds, we would need a libgd version which supports the custom allocators, and users of other platforms who build against the bundled libgd would need to be informed of that in advance. And of course, unbundling libgd would need an RFC.

Also this PR doesn't force packagers to use the most recent version of libgd because there are conditionals that get only turned on when you use a version that supports the custom allocators. Due to this, every other version still remains supported too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants