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

Consistency with numeric values #5

Open
EmielBruijntjes opened this issue Apr 22, 2014 · 2 comments
Open

Consistency with numeric values #5

EmielBruijntjes opened this issue Apr 22, 2014 · 2 comments
Assignees

Comments

@EmielBruijntjes
Copy link
Member

We currently use int, long and jit_type_sys_int to represent numeric values, and size_t to store string lengths. We need to check if all these types are the same, especially when you switch between jit and regular context.

@EmielBruijntjes
Copy link
Member Author

We probably only need long and jit_type_sys_long when we deal with numeric values, and size_t when working with string lengths, where we have to investigate what the identical type to a size_t is in libjit.

@schoentoon
Copy link
Contributor

As for libjit and the size_t typedef, a simple grep on the libjit header files revealed this to me.

/* TODO: the proper place for this is jit-def.h and it's going to depend on the platform. */
typedef unsigned int jit_size_t;

But as their TODO suggests it indeed depends on platform. Just like int, unsigned int is 32 bit with both 32 and 64 bit binaries, while sizeof(size_t) returns 8 for 64 bit binaries and 4 for 32 bit binaries. I think jit_type_sys_ulong is a better solution as it is the same size as size_t in both 32 and 64 bit binaries.

schoentoon pushed a commit that referenced this issue Apr 23, 2014
This is pretty much related to issue #5, numeric_t currently is still int,
so everything is behaving exactly as it was.
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

No branches or pull requests

2 participants