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

Conversation

@Headline
Copy link
Member

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
Contributor

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);

This comment has been minimized.

Copy link
@peace-maker

peace-maker May 9, 2018

Contributor

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.

This comment has been minimized.

Copy link
@asherkin

asherkin May 9, 2018

Member

Are you sure? I thought that was handled silently.

This comment has been minimized.

Copy link
@peace-maker

peace-maker May 9, 2018

Contributor

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
}
thanks pm
@Headline

This comment has been minimized.

Copy link
Member Author

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
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.