-
-
Save maasha/0520ce4ff6a319387de2 to your computer and use it in GitHub Desktop.
This file contains 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
builder.c %{ | |
void increment_C( | |
VALUE _count_ary, // Count ary. | |
VALUE _nodes_ary, // Nodes ary. | |
VALUE _length // Nodes ary length. | |
) | |
{ | |
int *count_ary = (int *) StringValuePtr(_count_ary); | |
int *nodes_ary = (int *) StringValuePtr(_nodes_ary); | |
int length = FIX2INT(_length); | |
int i = 0; | |
for (i = length - 1; i >= 0; i--) | |
{ | |
count_ary[nodes_ary[i]]++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment