Skip to content

Enable tests of proxy library on Windows Debug #417

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

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

ldorau
Copy link
Contributor

@ldorau ldorau commented Apr 6, 2024

Description

  1. Add _aligned_malloc() and _aligned_free() to Windows proxy library.
    _aligned_malloc() is a Windows variant of Linux aligned_alloc()

  2. Add proxy_lib_new_delete.h

    This header provides convenient overrides for the new and delete
    operations in C++. It should be included in only one source file.

    See: https://github.com/microsoft/mimalloc/tree/8f7d1e9a41bb0182166aac6a8d4d8b00f60ed032?tab=readme-ov-file#override_on_windows
    Fixes: The proxy library does not work in the Debug build on Windows #350

  3. Revert "Disable proxy lib tests on Windows Debug"

    This reverts commit 92fa419.

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly

@ldorau ldorau requested a review from a team as a code owner April 6, 2024 10:18
@ldorau ldorau force-pushed the Add_proxy_lib_new_delete.h branch from 4a1311c to 8bffca8 Compare April 8, 2024 07:41
@ldorau ldorau changed the title Add proxy lib new delete.h Enable tests of proxy library on Windows Debug Apr 8, 2024
@ldorau ldorau force-pushed the Add_proxy_lib_new_delete.h branch 2 times, most recently from 1a9c70f to 67e40fb Compare April 8, 2024 12:56
@ldorau ldorau force-pushed the Add_proxy_lib_new_delete.h branch 3 times, most recently from c744754 to 04bdc1e Compare April 8, 2024 15:23
@ldorau ldorau marked this pull request as draft April 8, 2024 15:30
@ldorau
Copy link
Contributor Author

ldorau commented Apr 8, 2024

Converting to draft, because of license issues. Please review anyway.

In case of Windows it requires:
1) explicitly linking your program dynamically with the `umf_proxy.dll` library
2) (C++ code only) including `proxy_lib_new_delete.h` in a single(!) source file in your project
to override also the `new`/`delete` operations.
Copy link
Member

Choose a reason for hiding this comment

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

If the user is supposed to include proxy_lib_new_delete.h then it should be in include dir, not src and we should install it along other headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@igchor Done

Copy link
Contributor

Choose a reason for hiding this comment

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

@igchor I checked that this new file is properly installed

@ldorau ldorau force-pushed the Add_proxy_lib_new_delete.h branch from 04bdc1e to 7306c81 Compare April 8, 2024 17:53
ldorau added 5 commits April 8, 2024 23:00
Add Microsoft aligned variants to Windows proxy library:
- _aligned_malloc()
- _aligned_realloc()
- _aligned_recalloc()
- _aligned_msize()
- _aligned_free()
- _aligned_offset_malloc()
- _aligned_offset_realloc()
- _aligned_offset_recalloc()

and remove _free_dbg().

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
This header provides convenient overrides for the new and delete
operations in C++. It should be included in only one source file.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Fixes: oneapi-src#350

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
This reverts commit 92fa419.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
@ldorau ldorau force-pushed the Add_proxy_lib_new_delete.h branch from 7306c81 to 56d93ed Compare April 8, 2024 21:07
@ldorau ldorau marked this pull request as ready for review April 8, 2024 21:07
@ldorau
Copy link
Contributor Author

ldorau commented Apr 8, 2024

PR is ready for re-review.

@ldorau ldorau requested review from bratpiorka and igchor April 8, 2024 21:21
@bratpiorka bratpiorka merged commit e331e55 into oneapi-src:main Apr 9, 2024
69 checks passed
@ldorau ldorau deleted the Add_proxy_lib_new_delete.h branch April 9, 2024 08:07
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.

The proxy library does not work in the Debug build on Windows
4 participants