Skip to content
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

convert page_aligned_vec!() into Qcow2Iobuf #3

Merged
merged 5 commits into from
Jan 17, 2024
Merged

convert page_aligned_vec!() into Qcow2Iobuf #3

merged 5 commits into from
Jan 17, 2024

Conversation

ming1
Copy link
Collaborator

@ming1 ming1 commented Jan 16, 2024

  • convert page_aligned_vec!() into Qcow2Iobuf, which is guaranteed that same alloc layout is used in both allocation
    and deallocation,

  • this way fixes "(exit code: 0xc0000374, STATUS_HEAP_CORRUPTION)" when running cargo test

  • add CI for covering windows build & test

page_aligned_vec!() is like one hacky, and it may trigger STATUS_HEAP_CORRUPTION
when running 'cargo test'.

The reason is that windows with 'cargo test' requires Vec buffer to be
freed with same alloc layout(alignment, size). Obviously,
page_aligned_vec!() can be implemented in that way.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Meta handling is the most tricky part wrt. using page_aligned_vec!().

Move Qcow2IoBuf object into Meta instance(L1, L2, RefTable, RefBlock)
directly, and retrieve everything from this buffer.

Turns out this way is simpler than before.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
All conversions are straightforward.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Now it is ready to setup windows CI since Qcow2IoBuf is used, and
same alloc layout is used for both allocation and deallocation.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
@ming1 ming1 merged commit 5aee7e2 into main Jan 17, 2024
4 checks passed
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.

None yet

1 participant