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

Make Bounds Checking a Runtime Toggle #91

Closed
JPWatson opened this issue May 1, 2019 · 2 comments · Fixed by #92
Closed

Make Bounds Checking a Runtime Toggle #91

JPWatson opened this issue May 1, 2019 · 2 comments · Fixed by #92

Comments

@JPWatson
Copy link
Collaborator

JPWatson commented May 1, 2019

Moved from real-logic/simple-binary-encoding#492 (@juddgaddie)

Like Java, C# (unlike c/c++) is typically not compiled from sources for that reason I think the bounds checking would be better served with a runtime toggle we could use system environment variables (the same approach as c or c++ code uses for runtime configuration).

I also would think the default build that goes to Nuget should have bounds checking enabled by default.

Example of what I mean here: https://gist.github.com/juddgaddie/eeafbbb195a332bf72808748cdcd4336

@JPWatson
Copy link
Collaborator Author

JPWatson commented May 1, 2019

@juddgaddie Yep I'm on board with that in theory, I just have two reservations.

  1. Would like to make sure there is no performance penalty (i.e. the JIT correctly optimises).
  2. The environment variables for configuration is less idiomatic in .NET (but I can't think of any alternatives).

@juddgaddie
Copy link
Contributor

As an alternative to 2. we could move Adaptive.Aeron/Config.cs into Adaptive.Agrona and then use the -D command line args. This would be more consistent with both the Java implementation and the .NET aeron port.

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 a pull request may close this issue.

2 participants