-
Notifications
You must be signed in to change notification settings - Fork 0
hw2 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Вариант #17 |
Codecov Report
@@ Coverage Diff @@
## main #1 +/- ##
=======================================
Coverage ? 88.41%
=======================================
Files ? 5
Lines ? 233
Branches ? 0
=======================================
Hits ? 206
Misses ? 27
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
|
lib/utils/src/utils.c
Outdated
char *word = strtok(copy, " "); | ||
if (word == NULL) { | ||
free(copy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ради использования strtock ты создаешь дополнительный буффер размером 100мб? А если входная строка будет 10гб?
lib/word_search/src/word_search.c
Outdated
if (longest_word == NULL) { | ||
free(string_of_words); | ||
return NULL; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ты не должен удалять переданный из вне массив внутри функции
lib/word_search/src/word_search.c
Outdated
return NULL; | ||
} | ||
|
||
char *longest_word = (char *) malloc(strlen(string_of_words) * sizeof(char)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Создаешь второй огромный буффер?
char mtext[BUFF_SIZE]; | ||
} message_buff; | ||
|
||
char *find_longest_word(char *string_of_words) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
функция слишком большая, разбей
lib/word_search/src/word_search.c
Outdated
while (string_of_words[i] != ' ' && string_of_words[i] !='\0') { | ||
current_word[j] = string_of_words[i]; | ||
i++; | ||
j++; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше вынести в функцию принимающую char *dest, const char *src
} message_buff; | ||
|
||
|
||
void child_procs_work(char *string_of_words, size_t current_procs_numb, size_t number_of_procs, int q_id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
слишком длинная функция
No description provided.