Skip to content

Homework #1#1

Open
mashfeii wants to merge 1 commit intomasterfrom
hm-1
Open

Homework #1#1
mashfeii wants to merge 1 commit intomasterfrom
hm-1

Conversation

@mashfeii
Copy link
Owner

Created the header and source file for the Allocator
Made the source file for the test
Edited the Makefile for the possibility of a test

Copy link
Collaborator

@tarasovxx tarasovxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Код в целом хороший, но есть некоторые моменты, которые можно улучшить для повышения стабильности и читаемости.


void Allocator::makeAllocator(size_t max_size) {
if (max_size == 0)
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавить вывод (логирование), чтобы пользователь понимал, что не так

try {
ptr_ = new char[max_size];
} catch (...) {
throw;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это избыточно. Если не собираешься обрабатывать исключение, лучше вообще не использовать try-catch. Так как это тяжелая конструкция.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants