Finite inkatate
This commit is contained in:
@@ -440,12 +440,16 @@ void reduce(const char *toReduce, size_t worker_count, char **worker_ports, void
|
||||
|
||||
while (offset < toReduce_len) {
|
||||
size_t remaining = toReduce_len - offset;
|
||||
size_t chunk_size = (remaining > PAYLOAD_LENGTH) ? PAYLOAD_LENGTH - 1 : remaining;
|
||||
size_t chunk_size = (remaining >= PAYLOAD_LENGTH) ? PAYLOAD_LENGTH - 1 : remaining;
|
||||
|
||||
if (offset + chunk_size < toReduce_len) {
|
||||
size_t adjust = chunk_size;
|
||||
|
||||
while (adjust > 0 && !isdigit((unsigned char)toReduce[offset + adjust - 1])) {
|
||||
while (adjust > 0 && isdigit((unsigned char)toReduce[offset + adjust - 1])) {
|
||||
adjust--;
|
||||
}
|
||||
|
||||
while (adjust > 0 && isalpha((unsigned char)toReduce[offset + adjust - 1])) {
|
||||
adjust--;
|
||||
}
|
||||
|
||||
@@ -642,6 +646,11 @@ int main(const int argc, char **argv) {
|
||||
free(words_list);
|
||||
words_list = NULL;
|
||||
|
||||
#if false
|
||||
free(word_list_mapped);
|
||||
word_list_mapped = strdup("und11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111und11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111und111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111un1und11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111");
|
||||
#endif
|
||||
|
||||
// REDUCE
|
||||
reduce(word_list_mapped, argc - 2, argv + 2, context);
|
||||
free(word_list_mapped);
|
||||
@@ -657,14 +666,14 @@ int main(const int argc, char **argv) {
|
||||
|
||||
// fprintf(stderr, "REDUCE:\n%s\n", word_list_reduced);
|
||||
|
||||
// RIP
|
||||
rip(argc - 2, argv + 2, context);
|
||||
|
||||
// print words_list
|
||||
print_words_list(word_list_reduced);
|
||||
free(word_list_reduced);
|
||||
word_list_reduced = NULL;
|
||||
|
||||
// RIP
|
||||
rip(argc - 2, argv + 2, context);
|
||||
|
||||
pthread_mutex_destroy(&words_mutex);
|
||||
pthread_mutex_destroy(&context_mutex);
|
||||
zmq_ctx_destroy(context);
|
||||
|
||||
Reference in New Issue
Block a user