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

feat: 0.4.6 Add support for custom error handlers #79

Merged
merged 11 commits into from
Sep 2, 2024
Merged

feat: 0.4.6 Add support for custom error handlers #79

merged 11 commits into from
Sep 2, 2024

Conversation

jgabaut
Copy link
Owner

@jgabaut jgabaut commented Aug 29, 2024

Added

  • Add support for custom error handlers in push calls
    • Out-Of-Memory
    • PTRDIFF_MAX constraint violation
  • Add KLS_Err_Handlers to hold the handlers together
  • Add new err_handlers field to KLS_Conf
  • Add default handlers for all existing APIs:
    #ifndef KOLISEO_HAS_LOCATE
    void KLS_OOM_default_handler__(
        Koliseo* kls,
        ptrdiff_t available,
        ptrdiff_t padding,
        ptrdiff_t size,
        ptrdiff_t count
    );
    void KLS_PTRDIFF_MAX_default_handler__(
        Koliseo* kls,
        ptrdiff_t size,
        ptrdiff_t count
    );
    #else
    void KLS_OOM_default_handler_dbg__(
        Koliseo* kls,
        ptrdiff_t available,
        ptrdiff_t padding,
        ptrdiff_t size,
        ptrdiff_t count,
        Koliseo_Loc loc
    );
    void KLS_PTRDIFF_MAX_default_handler_dbg__(
        Koliseo* kls,
        ptrdiff_t size,
        ptrdiff_t count
    );
    #endif // KOLISEO_HAS_LOCATE
  • Add new constructors with custom OOM handler arguments
    • kls_new_traced_handled() // Macro
    • kls_new_dbg_handled() // Macro
    • kls_new_traced_AR_KLS_handled() // Function
    • kls_new_traced_alloc_handled() // Function
    • kls_new_dbg_alloc_handled() // Function
    • kls_new_traced_AR_KLS_alloc_handled() // Function
  • Add new kls_conf_init_handled() to pass handlers with a custom KLS_Conf
  • Add KLS_DEFAULT_ERR_HANDLERS macro

Changed

  • Drop ncurses, title features and all related symbols
  • The previous banner can be found in static/kls_banner.c

@jgabaut jgabaut added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 29, 2024
@jgabaut jgabaut self-assigned this Aug 29, 2024
@jgabaut jgabaut marked this pull request as draft August 29, 2024 19:45
@jgabaut jgabaut changed the title feat: 0.4.6 Drop ncurses, title features feat: 0.4.6 Add support for custom OOM handlers Aug 30, 2024
@jgabaut jgabaut marked this pull request as ready for review September 1, 2024 12:32
@jgabaut jgabaut changed the title feat: 0.4.6 Add support for custom OOM handlers feat: 0.4.6 Add support for custom error handlers Sep 2, 2024
@jgabaut jgabaut merged commit ec00eda into master Sep 2, 2024
2 checks passed
@jgabaut jgabaut deleted the devel branch September 2, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant