Skip to content

feat(extgen): multiple improvements on C generated code#1698

Merged
dunglas merged 1 commit intophp:mainfrom
alexandre-daubois:extgen-imp
Jun 30, 2025
Merged

feat(extgen): multiple improvements on C generated code#1698
dunglas merged 1 commit intophp:mainfrom
alexandre-daubois:extgen-imp

Conversation

@alexandre-daubois
Copy link
Copy Markdown
Member

@alexandre-daubois alexandre-daubois commented Jun 27, 2025

This PR brings some improvements to the generated C code of the extension generator. Here are the changes:

  • Remove class_name from object structure, it is unused
  • Remove useless get_method
  • Make objets constructor no-op when called more than once
  • Disable objects cloning. Trying to do so will result in the following error: Uncaught Error: Trying to clone an uncloneable object of class MySuperClass. We could implement the clone fairly easily I guess, but let's keep it simple for now
  • Remove unnecessary structs in extension header file

Comment thread internal/extgen/templates/extension.c.tpl
@alexandre-daubois alexandre-daubois force-pushed the extgen-imp branch 2 times, most recently from 8d1e4e8 to 579e083 Compare June 27, 2025 13:01
@dunglas dunglas merged commit 58fde42 into php:main Jun 30, 2025
43 checks passed
@dunglas
Copy link
Copy Markdown
Member

dunglas commented Jun 30, 2025

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants