Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
3556e457
Commit
3556e457
authored
10 years ago
by
Dave Hylands
Browse files
Options
Downloads
Patches
Plain Diff
Allow real memory errors (from locked gc) to be reported with traceback.
parent
67f25dfe
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
py/runtime.c
+8
-1
8 additions, 1 deletion
py/runtime.c
stmhal/printf.c
+2
-1
2 additions, 1 deletion
stmhal/printf.c
unix/mpconfigport.h
+1
-1
1 addition, 1 deletion
unix/mpconfigport.h
with
11 additions
and
3 deletions
py/runtime.c
+
8
−
1
View file @
3556e457
...
...
@@ -51,6 +51,7 @@
#include
"parsehelper.h"
#include
"compile.h"
#include
"stackctrl.h"
#include
"gc.h"
#if 0 // print debugging info
#define DEBUG_PRINT (1)
...
...
@@ -1207,7 +1208,13 @@ mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_i
void
*
m_malloc_fail
(
size_t
num_bytes
)
{
DEBUG_printf
(
"memory allocation failed, allocating "
UINT_FMT
" bytes
\n
"
,
num_bytes
);
nlr_raise
((
mp_obj_t
)
&
mp_const_MemoryError_obj
);
if
(
gc_is_locked
())
{
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_MemoryError
,
"memory allocation failed, heap is locked"
));
}
else
{
nlr_raise
(
mp_obj_new_exception_msg_varg
(
&
mp_type_MemoryError
,
"memory allocation failed, allocating "
UINT_FMT
" bytes"
,
num_bytes
));
}
}
NORETURN
void
mp_not_implemented
(
const
char
*
msg
)
{
...
...
This diff is collapsed.
Click to expand it.
stmhal/printf.c
+
2
−
1
View file @
3556e457
...
...
@@ -67,8 +67,9 @@ int vprintf(const char *fmt, va_list ap) {
}
#if MICROPY_DEBUG_PRINTERS
mp_uint_t
mp_verbose_flag
=
1
;
int
DEBUG_printf
(
const
char
*
fmt
,
...)
{
(
void
)
stream
;
va_list
ap
;
va_start
(
ap
,
fmt
);
int
ret
=
pfenv_vprintf
(
&
pfenv_stdout
,
fmt
,
ap
);
...
...
This diff is collapsed.
Click to expand it.
unix/mpconfigport.h
+
1
−
1
View file @
3556e457
...
...
@@ -72,7 +72,7 @@
#endif
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (
128
)
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (
256
)
extern
const
struct
_mp_obj_module_t
mp_module_os
;
extern
const
struct
_mp_obj_module_t
mp_module_time
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment