Skip to content

Instantly share code, notes, and snippets.

@kosmolot
Created July 8, 2017 10:36
Show Gist options
  • Save kosmolot/0ed2f6f32d22e65f6a223174e6f32439 to your computer and use it in GitHub Desktop.
Save kosmolot/0ed2f6f32d22e65f6a223174e6f32439 to your computer and use it in GitHub Desktop.
Array concatenation (Vala)
/**
* This function doesn't use generic,
* because of 'sizeof(T)' problem.
*/
public void[] array_concat (void[] a, void[] b) {
void[] c = new void[a.length + b.length];
Memory.copy(c, a, a.length);
Memory.copy(&c[a.length], b, b.length);
return c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment