Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nikita Kuznetsov
assignment-memory-allocator
Commits
934c080c
Commit
934c080c
authored
3 years ago
by
Nikita Kuznetsov
Browse files
Options
Download
Email Patches
Plain Diff
фикс
parent
8c890d8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/mem.c
src/mem.c
+2
-2
No files found.
src/mem.c
View file @
934c080c
...
...
@@ -73,9 +73,9 @@ static bool block_splittable(struct block_header* restrict block, size_t query)
static
bool
split_if_too_big
(
struct
block_header
*
block
,
size_t
query
)
{
if
(
block_splittable
(
block
,
query
))
{
const
block_
capacity
new_capacity
=
{
.
bytes
=
block
->
capacity
.
bytes
-
(
query
+
offsetof
(
struct
block_header
,
contents
))
};
const
block_
size
new_size
=
{
.
bytes
=
block
->
capacity
.
bytes
-
(
query
+
offsetof
(
struct
block_header
,
contents
))
};
block
->
capacity
.
bytes
=
query
;
block_init
(
block_after
(
block
),
size
_from_capacity
(
new_capacity
)
,
block
->
next
);
block_init
(
block_after
(
block
),
new_
size
,
block
->
next
);
block
->
next
=
block_after
(
block
);
return
true
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment