-
Notifications
You must be signed in to change notification settings - Fork 423
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
Add c_sizeof_object()
for classes?
#26015
Comments
I would advocate for a name not prefixed with I would suggest the name |
I'm not opposed to that, but for the sake of argument, why does it make more sense as a Chapel feature than (Note that a challenge to doing so—and a big part of why we currently only have If we did think that it should be a Chapel-level routine but be class-specific, then I think we should call it |
My thinking was that
Hmm I didn't think about these cases. To my mind, |
Note that I came across this old issue which asks for something very similar |
Ooh, good catch! I'm going to add the user issues label here for that reason, but am going to keep this one open as we;; since we've had more discussion on it. |
Applying a
c_sizeof()
to a class variable likec
here:returns the size of the pointer-to-object part of the class, and not the size of the class itself. This seems correct/appropriate to me, but I think we should also support a way to get the size of the object it's pointing to. Trying to come up with a user-facing way to do this was surprisingly challenging (like, I couldn't do it), and seems like a query we should make easy.
With a tip from Jade, it seems like the implementation may be as easy as:
I suppose there's some question as to whether this should be a
c_
routine or just a Chapel routine given that mostc_
features prefix a C symbol, andsizeof_object
isn't (to my knowledge—and if it is, it probably means something different s.t. we should use a different name?).The text was updated successfully, but these errors were encountered: