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

Create a bit set API #1162

Open
singhbabneet opened this issue May 24, 2017 · 2 comments
Open

Create a bit set API #1162

singhbabneet opened this issue May 24, 2017 · 2 comments

Comments

@singhbabneet
Copy link

singhbabneet commented May 24, 2017

This API will be part of the port library. It will help reduce redundant code in the port library.

typedef OMR_Bitfield uint32_t*; 

omrutil_bitfield_is_set(const OMR_Bitfield bitfield, size_t index); 

omrutil_bitfield_set(OMR_Bitfield bitfield, size_t index);

uint8_t* or char* will be preferred over uint32_t*. Note - check if it is feasible to convert existing uint32_t* usage to uint8_t* or char*.

@0xdaryl
Copy link
Contributor

0xdaryl commented May 24, 2017

Note that the OMR compiler already has something similar (see compiler/infra/Flags.hpp). Perhaps there's an opportunity for a similar solution to be used across multiple components in OMR (I'm not saying its Flags.hpp or what you are proposing, but perhaps some middle ground that can be used everywhere). Please keep it in mind.

@singhbabneet
Copy link
Author

Agreed. Flags.hpp has a lot of functionality which can be used to create a bit manipulation API. But, port library won't be able to support C++ code. DDR will not function properly. So, an equivalent C API can be added. template <class T>: T can be replaced with uint8_t* or uint8_t[SIZE] to support different flag sizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants