Skip to content

Conversation

@HerrCai0907
Copy link
Member

create 2 kinds constructor can help binaryen to optimize code better. since binaryen cannot optimize conditional allocation in base class. It will be obvious for ~lib/object/Object because it is the base class for all kinds of class.

@HerrCai0907
Copy link
Member Author

@CountBleck
Copy link
Member

Uh, what's the difference between the raw constructor and the normal constructor?

@HerrCai0907
Copy link
Member Author

The raw constructor will not allocate memory, it is used for inherited class's constuctor.

@CountBleck
Copy link
Member

I don't think I can say much besides that it looks really strange...is there a way to have the normal constructor just call the "raw" constructor, instead of creating two distinct types of constructors?

@HerrCai0907
Copy link
Member Author

It introduce more complexity when @inline is set. Since inlined constructor should inline to the caller site. It lets inline meaningless if we just call "raw_constructor" in normal constructor.

@HerrCai0907 HerrCai0907 closed this Sep 4, 2025
@HerrCai0907 HerrCai0907 deleted the opt-ctor branch September 4, 2025 14:00
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