Created
July 8, 2017 10:36
-
-
Save kosmolot/0ed2f6f32d22e65f6a223174e6f32439 to your computer and use it in GitHub Desktop.
Array concatenation (Vala)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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