SpiNNFrontEndCommon
7.2.2
Common support code for user-facing front end systems.
Loading...
Searching...
No Matches
front_end_common_lib
include
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
27
typedef
enum
exit_states_for_user_one
{
29
EXITED_CLEANLY
= 0,
31
EXIT_FAIL
= 1,
33
EXIT_MALLOC
= 2,
35
EXIT_SWERR
= 3,
37
DETECTED_MALLOC_FAILURE
= 4
38
}
exit_states_for_user_one
;
39
40
// ===========================================================================
41
44
void
malloc_extras_turn_on_print
(
void
);
45
47
void
malloc_extras_turn_off_print
(
void
);
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
74
uint
malloc_extras_max_available_block_size
(
void
);
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__
common-typedefs.h
Data type definitions for SpiNNaker Neuron-modelling.
debug.h
SpiNNaker debug header file.
malloc_extras_max_available_block_size
uint malloc_extras_max_available_block_size(void)
Locates the biggest block of available memory from the heaps.
malloc_extras_malloc
void * malloc_extras_malloc(uint bytes)
Allows a search of the 2 heaps available. (DTCM, stolen SDRAM)
Definition
malloc_extras.c:99
malloc_extras_sdram_malloc
void * malloc_extras_sdram_malloc(uint bytes)
Mallocs a number of bytes from SDRAM.
Definition
malloc_extras.c:84
exit_states_for_user_one
exit_states_for_user_one
The different states to report through vcpu->user1
Definition
malloc_extras.h:27
EXITED_CLEANLY
@ EXITED_CLEANLY
Everything is fine.
Definition
malloc_extras.h:29
EXIT_FAIL
@ EXIT_FAIL
We went wrong but we dont want to RTE.
Definition
malloc_extras.h:31
EXIT_MALLOC
@ EXIT_MALLOC
We ran out of space and we want to RTE.
Definition
malloc_extras.h:33
DETECTED_MALLOC_FAILURE
@ DETECTED_MALLOC_FAILURE
We detected a problem and want to RTE.
Definition
malloc_extras.h:37
EXIT_SWERR
@ EXIT_SWERR
We hit an internal error and we want to RTE.
Definition
malloc_extras.h:35
malloc_extras_terminate
void malloc_extras_terminate(uint result_code)
Stops execution with a result code.
Definition
malloc_extras.c:57
malloc_extras_free
void malloc_extras_free(void *ptr)
Frees a pointer without any marker for application code.
Definition
malloc_extras.c:68
malloc_extras_turn_off_print
void malloc_extras_turn_off_print(void)
Turn off printing.
Definition
malloc_extras.c:50
malloc_extras_turn_on_print
void malloc_extras_turn_on_print(void)
Turn on printing.
Definition
malloc_extras.c:46
sark.h
uint
unsigned int uint
Generated by
1.9.8