Skip to content

investigate Box::new_in issue with custom allocator #7

Closed
@hannahfluch

Description

@hannahfluch

Creating a new box on the heap with a reference to the global allocator panics with the following error message:

unsafe precondition(s) violated: ptr::read requires that the pointer argument is aligned and non-null

_ = Box::new_in(0, &Global);

Passing the global allocator directly makes the allocation work smoothly:
_ = Box::new_in(0, Global);

The problem may be related to this or this issue. Although, they have seemingly been resolved.

Testing with this heap allocator does not solve the problem.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions