Skip to content

Conversation

@lkirk
Copy link
Owner

@lkirk lkirk commented Sep 12, 2025

This revision moves all malloc operations out of the hot loop in two-locus statistics, instead providing pre-allocated regions of memory that the two-locus framework will use to perform work. Instead of simply passing each pre-allocated array into each function call, we introduce a simple structure called two_locus_work_t, which stores the statistical results, and provides temporary arrays for storing the normalisation constants. Setup and teardown methods for this work structure are provided. All test (python and C) are passing and valgrind reports no memory leaks.

This revision moves all malloc operations out of the hot loop in
two-locus statistics, instead providing pre-allocated regions of memory
that the two-locus framework will use to perform work. Instead of simply
passing each pre-allocated array into each function call, we introduce a
simple structure called `two_locus_work_t`, which stores the statistical
results, and provides temporary arrays for storing the normalisation
constants. Setup and teardown methods for this work structure are
provided. All test (python and C) are passing and valgrind reports no
memory leaks.
@lkirk lkirk closed this Sep 12, 2025
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.

2 participants