Skip to content

unable to override functions in recent exception / xmemory changes #202

Description

@angelfor3v3r

previously, this function:

_NODISCARD constexpr size_t _Get_size_of_n(const size_t _Count) {
.. returned (size_t)( -1 ).

within the last few months, the function now calls into _Throw_bad_array_new_length which uses the _THROW macro and will result in code generation importing functions from MSVC libraries.

previously, a user was able to suppress generation of these exceptions by disabling them with compiler flags and specifying #define _HAS_EXCEPTIONS 0.

since these "new" throw functions already have a body defined, a user cannot override them with their own implementation. the other exception functions have a definition here:

[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xbad_alloc();
... which allow a user to provide their own implementation (and, resulting in strings and exception imports to be omitted).

are there any changes planned for this? a new way to get add your own implementation for exception handling? or have exception / xmemory actually listen to the _HAS_EXCEPTIONS preprocessor definition?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions