SpiNNFrontEndCommon  7.4.2
Common support code for user-facing front end systems.
malloc_extras.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 The University of Manchester
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
19 #ifndef __MALLOC_EXTRAS_H__
20 #define __MALLOC_EXTRAS_H__
21 
22 #include <sark.h>
23 #include <common-typedefs.h>
24 #include <debug.h>
25 
31  EXIT_FAIL = 1,
39 
40 // ===========================================================================
41 
45 
48 
51 void malloc_extras_terminate(uint result_code);
52 
55 void malloc_extras_free(void *ptr);
56 
62 void *malloc_extras_sdram_malloc(uint bytes);
63 
70 void *malloc_extras_malloc(uint bytes);
71 
75 
77 #define MALLOC malloc_extras_malloc
79 #define FREE malloc_extras_free
81 #define FREE_MARKED malloc_extras_free_marked
83 #define MALLOC_SDRAM malloc_extras_sdram_malloc_wrapper
84 
85 #endif // __PLATFORM_H__
Data type definitions for SpiNNaker Neuron-modelling.
SpiNNaker debug header file.
uint malloc_extras_max_available_block_size(void)
Locates the biggest block of available memory from the heaps.
exit_states_for_user_one
The different states to report through vcpu->user1
Definition: malloc_extras.h:27
@ EXITED_CLEANLY
Everything is fine.
Definition: malloc_extras.h:29
@ EXIT_FAIL
We went wrong but we dont want to RTE.
Definition: malloc_extras.h:31
@ EXIT_MALLOC
We ran out of space and we want to RTE.
Definition: malloc_extras.h:33
@ DETECTED_MALLOC_FAILURE
We detected a problem and want to RTE.
Definition: malloc_extras.h:37
@ EXIT_SWERR
We hit an internal error and we want to RTE.
Definition: malloc_extras.h:35
void malloc_extras_terminate(uint result_code)
Stops execution with a result code.
Definition: malloc_extras.c:57
void malloc_extras_free(void *ptr)
Frees a pointer without any marker for application code.
Definition: malloc_extras.c:68
void * malloc_extras_sdram_malloc(uint bytes)
Mallocs a number of bytes from SDRAM.
Definition: malloc_extras.c:84
void * malloc_extras_malloc(uint bytes)
Allows a search of the 2 heaps available. (DTCM, stolen SDRAM)
Definition: malloc_extras.c:99
void malloc_extras_turn_off_print(void)
Turn off printing.
Definition: malloc_extras.c:50
void malloc_extras_turn_on_print(void)
Turn on printing.
Definition: malloc_extras.c:46