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

TO_SEXP #26

Open
FeggieBoss opened this issue Nov 20, 2023 · 1 comment
Open

TO_SEXP #26

FeggieBoss opened this issue Nov 20, 2023 · 1 comment

Comments

@FeggieBoss
Copy link

FeggieBoss commented Nov 20, 2023

#define TO_DATA(x) ((data *)((char *)(x)-DATA_HEADER_SZ))

#define TO_SEXP(x) ((sexp *)((char *)(x)-DATA_HEADER_SZ))

Is it suppose to be SEXP_HEADER_SZ ((sizeof(int) + sizeof(size_t) + sizeof(int))) in TO_SEXP?

@danyaberezun
Copy link
Collaborator

No. It may be an unfortunate naming but there is no bug here. TO_SEXP accepts a raw pointer which in case of s-expression is actually a pointer to s-expression's tag rather than to "raw" data.

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