Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Profiler methodmap #814

Merged
merged 4 commits into from Jul 8, 2018
Merged

Add Profiler methodmap #814

merged 4 commits into from Jul 8, 2018

Conversation

@Headline
Copy link
Member

@Headline Headline commented May 9, 2018

Think this is one of the last Handle types without a method map, decided to piece together a small patch to change that.

Copy link
Member

@peace-maker peace-maker left a comment

This should apply to all similar new methodmaps.


/**
* Starts profiling.
*
* @param prof Profiling object.
* @error Invalid Handle.
*/
native void StartProfiling(Handle prof);
Copy link
Member

@peace-maker peace-maker May 9, 2018

Choose a reason for hiding this comment

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

Thinking about changes like that - we don't have to change the tag here for old natives. This change will just make old code throw tag mismatch warnings if the profiler is just stored in a Handle variable.

Copy link
Member

@asherkin asherkin May 9, 2018

Choose a reason for hiding this comment

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

Are you sure? I thought that was handled silently.

Copy link
Member

@peace-maker peace-maker May 9, 2018

Choose a reason for hiding this comment

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

Just the other way around of expecting a Handle param but passing a methodmap X < Handle.

methodmap CoolNewThing < Handle {
};

native void DoStuff(CoolNewThing t);
native void DoMore(Handle t);

public void OnPluginStart()
{
	Handle thing;
	DoStuff(thing); // warning 213: tag mismatch
	
	CoolNewThing newThing;
	DoMore(newThing); // ok
}

@Headline
Copy link
Member Author

@Headline Headline commented May 9, 2018

My bad, thought those wouldn't throw mismatches. Hopefully all is well now.

Across sm we use `//` for methodmap docs, so lets just keep this consistent
@psychonic psychonic merged commit c09b320 into alliedmodders:master Jul 8, 2018
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants