Skip to content

Commit

Permalink
Merge branch 'master' into vm_as_normal
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B authored Jan 5, 2024
2 parents b358c8c + 77b787d commit 7ac91c7
Show file tree
Hide file tree
Showing 36 changed files with 152 additions and 4,268 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/c_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
uses: ./support/actions/apt-get-install
with:
packages: doxygen gcc-arm-none-eabi
- name: "Prepare: Set up Python 3.8"
- name: "Prepare: Set up Python 3.12"
# Note: Python is needed for spinn_utilities.make_tools when building
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.12
- name: "Prepare: Set SPINN_DIRS"
run: |
echo "Set SPINN_DIRS to $PWD/spinnaker_tools"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- name: Checkout
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
uses: ./support/actions/pytest
with:
tests: unittests fec_integration_tests
coverage: ${{ matrix.python-version == 3.8 }}
coverage: ${{ matrix.python-version == 3.12 }}
cover-packages: ${{ env.BASE_PKG }}
coveralls-token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -79,7 +79,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
python-version: [3.8]
python-version: [3.12]

steps:
- name: Checkout
Expand Down
70 changes: 1 addition & 69 deletions c_common/front_end_common_lib/include/malloc_extras.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,87 +37,19 @@ typedef enum exit_states_for_user_one {
DETECTED_MALLOC_FAILURE = 4
} exit_states_for_user_one;

//! An SDRAM block outside the heap
typedef struct sdram_block {
//! Base address of where the SDRAM block starts
uchar *sdram_base_address;
//! Size of block in bytes
uint size;
} sdram_block;

//! Holds host-allocated SDRAM blocks outside the heap
typedef struct available_sdram_blocks {
//! Number of blocks of SDRAM which can be utilised outside of alloc
int n_blocks;
//! VLA of SDRAM blocks
sdram_block blocks[];
} available_sdram_blocks;

// ===========================================================================

//! \brief Turn off safety code if wanted
void malloc_extras_turn_off_safety(void);

//! \brief Turn on printing
//! \note Printing of allocations can take a lot of IOBUF space.
void malloc_extras_turn_on_print(void);

//! \brief Turn off printing
void malloc_extras_turn_off_print(void);

//! \brief Get the pointer to the stolen heap
//! \return the heap pointer.
heap_t *malloc_extras_get_stolen_heap(void);

#if 0
static inline void terminate(uint result_code) __attribute__((noreturn));
#endif

//! \brief Stops execution with a result code
//! \param[in] result_code: code to put in user 1
void malloc_extras_terminate(uint result_code);

//! \brief Checks a pointer for safety stuff
//! \param[in] ptr: the malloc pointer to check for memory overwrites
//! \return true if nothing is broken, false if there was detected overwrites.
bool malloc_extras_check(void *ptr);

//! \brief Checks all malloc()s with a given marker.
//! \param[in] marker: the numerical marker for this test, allowing easier
//! tracking of where this check was called in the user application code
//! \internal probably should be a string marker, but meh
void malloc_extras_check_all_marked(int marker);

//! \brief Checks all malloc's for overwrites with no marker
//! \details Calls malloc_extras_check_all_marked(), but does not provide an
//! easy marker to track back to the application user code.
void malloc_extras_check_all(void);

//! \brief Update heap to join in the extra space from another heap.
//! \param[in] heap_location: address where heap is located
//! \return true states the initialisation was successful (or not)
bool malloc_extras_initialise_with_fake_heap(heap_t *heap_location);

//! \brief Builds a new heap based off stolen sdram blocks from cores
//! synaptic matrices.
//! \details Needs to merge in the true SDRAM free heap, as otherwise it's
//! impossible to free the block properly.
//! \param[in] sizes_region; the sdram address where the free regions exist
//! \return None
bool malloc_extras_initialise_and_build_fake_heap(
available_sdram_blocks *sizes_region);

//! \brief Builds a new heap with no stolen SDRAM and sets up the malloc
//! tracker.
//! \return true is a successful initialisation and false otherwise.
bool malloc_extras_initialise_no_fake_heap_data(void);

//! \brief Frees the sdram allocated from whatever heap it came from
//! \param[in] ptr: the address to free. could be DTCM or SDRAM
//! \param[in] marker: the numerical marker for this test, allowing easier
//! tracking of where this check was called in the user application code
void malloc_extras_free_marked(void *ptr, int marker);

//! \brief Frees a pointer without any marker for application code
//! \param[in] ptr: the pointer to free.
void malloc_extras_free(void *ptr);
Expand All @@ -127,7 +59,7 @@ void malloc_extras_free(void *ptr);
//! and size recordings.
//! \param[in] bytes: the number of bytes to allocate from SDRAM.
//! \return the pointer to the location in SDRAM to use in application code.
void *malloc_extras_sdram_malloc_wrapper(uint bytes);
void *malloc_extras_sdram_malloc(uint bytes);

//! \brief Allows a search of the 2 heaps available. (DTCM, stolen SDRAM)
//! \note Commented out as this can cause stack overflow issues quickly.
Expand Down
Loading

0 comments on commit 7ac91c7

Please sign in to comment.