Acme-Parataxis

 view release on metacpan or  search on metacpan

Changes.md  view on Meta::CPAN


### Fixed?
- Arguments passed to a fiber might not be released until the fiber object was destroyed.

## [v0.0.6] - 2026-02-18

### Fixed
- Resolved assertion failures in `Perl_cx_popsub_args` and `Perl_pp_entersub` when running on a `DEBUGGING` build of Perl. This was fixed by ensuring `CvDEPTH` and pads are correctly restored during context switches. (I hope...)

### Added
- Added `--debug` build to GitHub Actions matrix to ensure future compatibility with Perl debugging builds.

### Changed
- Refactored `swap_perl_state` to be more robust regarding Perl's internal stack management.

## [v0.0.5] - 2026-02-18

### Changed
- I'm honeslty just throwing stuff at the wall. Between my local machines and GH CI workflows, I cannot replicate some of the failures I'm seeing from smokers which makes them virtually impossible to resolve.

## [v0.0.4] - 2026-02-17

lib/Acme/Parataxis.c  view on Meta::CPAN

#undef PARA_ASM_ENTRY
#undef PARA_ASM_VIS
#undef PARA_ASM_TYPE
#undef PARA_ASM_SIZE
#endif /* USE_AARCH64_ASM_CORO */
#endif /* USE_ASM_CORO */

/**
 * @brief Get the Operating System's unique Thread ID.
 *
 * Useful for debugging to prove that background tasks are running on different OS threads than the main Perl
 * interpreter.
 *
 * @return int The TID (Windows) or LWP ID (Linux/BSD/macOS).
 */
int get_os_thread_id() {
#ifdef _WIN32
    return (int)GetCurrentThreadId();
#elif defined(__APPLE__)
    uint64_t tid;
    pthread_threadid_np(NULL, &tid);

lib/Acme/Parataxis.c  view on Meta::CPAN

            return 1;
    return 0;
}

/** @brief TRUE if a live frame for cv sits on the depositing (from) or resuming (to) stack.
 *
 * Pass 1c runs after PL_curstackinfo already points at the resuming stack, so the depositing stack is
 * only reachable through the fiber struct. Both are asked directly, over their whole runlevel chain,
 * because a pinned CV can still own a frame that no claim in the register accounts for. Settling such
 * a CV to CvDEPTH 0 zeroes the depth its live frame needs, and the frame's own pop then trips core's
 * cx_popsub_args assert (Padlist[CvDEPTH] == PL_curpad) or, in a non-debug build, reads @_ out of
 * the wrong pad. */
static int para_cv_live_on_swap(pTHX_ para_fiber_t * from, para_fiber_t * to, CV * cv) {
    if (from && from->si && para_si_has_frame(from->si, cv))
        return 1;
    if (to && to != from && to->si && para_si_has_frame(to->si, cv))
        return 1;
    return 0;
}

/** @brief Drops every claim the registry holds for a CV, leaving the (dead) key in place.

lib/Acme/Parataxis/Generator.pod  view on Meta::CPAN

    while ( !$gen->is_done ) {
        my $v = $gen->next;
        process($v) if defined $v;
    }

Returns true if the generator has finished execution (whether it returned normally or threw an exception), and false if
it is still suspended awaiting the next pull.

=head2 C<fiber( )>

Returns the underlying private C<Acme::Parataxis> fiber object. Intended for debugging and ID inspection.

=head1 Recipes

=head2 Safely consuming sequences that contain C<undef>

The idiom C<< while ( defined(my $v = $gen->next) ) >> halts prematurely if the sequence legitimately yields C<undef>.
Test C<is_done()> instead:

    sub drain ($gen) {
        my @items;



( run in 1.546 second using v1.01-cache-2.11-cpan-c32d3c3b8f1 )