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

Remove dumb CodeBlock duplication in the emitters. #253

Merged
merged 1 commit into from Apr 9, 2014

Conversation

Sonicadvance1
Copy link
Contributor

Fixes issue 6990.
This uses a bit of templating to remove the duplicate code that is the CodeBlocks in each emitter headers.
No actual functionality change in this.

@Tilka
Copy link
Member

Tilka commented Apr 9, 2014

lgtm

void ClearCodeSpace()
{
// x86/64: 0xCC = breakpoint
memset(region, 0xCC, region_size);

This comment was marked as off-topic.

@Sonicadvance1
Copy link
Contributor Author

All comments addressed, when changing the CodeBlock class to NonCopyable, I had to drop it from the VertexLoader and DSPEmitter since they inherit from the CodeBlock class.

// You get memory management for free, plus, you can use all emitter functions without
// having to prefix them with gen-> or something similar.
// Example implementation:
// class JIT : public CodeBlock<ARMXEmitter> {}

This comment was marked as off-topic.

This comment was marked as off-topic.

@Sonicadvance1
Copy link
Contributor Author

Comments have been addressed

template<class T> class CodeBlock : public T, NonCopyable
{
private:
// A privately use function to set the executable RAM space to something invalid.

This comment was marked as off-topic.

Fixes issue 6990.
This uses a bit of templating to remove the duplicate code that is the CodeBlocks in each emitter headers.
No actual functionality change in this.
@delroth
Copy link
Member

delroth commented Apr 9, 2014

LGTM, I'll wait a bit for Buildbot to complete and will merge unless someone has an objection in the next 5min.

delroth added a commit that referenced this pull request Apr 9, 2014
Remove dumb CodeBlock duplication in the emitters.
@delroth delroth merged commit 4deb8f4 into dolphin-emu:master Apr 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants