-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Realloc is a bit confusing #107875
Copy link
Copy link
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Type
Fields
Give feedbackNo fields configured for issues without a type.
Location
https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#method.realloc
Summary
Realloc (in the trait for GlobalAlloc) is confusing in my opinion, what means the
new_sizeparameter?The size in bytes or how many times the size that is inside the layout?
In the way it is written seems to mean the bytes but it should be explicit that it means the size in bytes.