Skip to content

Instantly share code, notes, and snippets.

@bmyerz
Last active August 29, 2015 14:19
Show Gist options
  • Save bmyerz/4ac060c35f9dbd5f64fb to your computer and use it in GitHub Desktop.
Save bmyerz/4ac060c35f9dbd5f64fb to your computer and use it in GitHub Desktop.
code that is candidate for object flattening optimization
// pgas pseudocode, borrowing syntax from Chapel and UPC
struct global_ptr_string {
int len;
global const char* str;
global_ptr_string(...) { ... }
}
const global_ptr_string x(...);
on(10) {
for (int i=0; x.str[i]!='\0'; i++) {
printchar (x.str[i])
}
print ("\n")
}
@bholt
Copy link

bholt commented Apr 16, 2015

this is exactly the kind of thing I remember wishing Chapel would do for me. That or just make const things available everywhere so I didn't have to worry about where they lived.

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