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
GitLab 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
fd40a9c3
Commit
fd40a9c3
authored
Jan 1, 2015
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py: Make GC's STACK_SIZE definition a proper MICROPY_ config variable.
parent
872a8297
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/gc.c
+2
-3
2 additions, 3 deletions
py/gc.c
py/mpconfig.h
+5
-0
5 additions, 0 deletions
py/mpconfig.h
with
7 additions
and
3 deletions
py/gc.c
+
2
−
3
View file @
fd40a9c3
...
...
@@ -47,7 +47,6 @@
#define WORDS_PER_BLOCK (4)
#define BYTES_PER_BLOCK (WORDS_PER_BLOCK * BYTES_PER_WORD)
#define STACK_SIZE (64) // tunable; minimum is 1
STATIC
byte
*
gc_alloc_table_start
;
STATIC
mp_uint_t
gc_alloc_table_byte_len
;
...
...
@@ -62,7 +61,7 @@ STATIC mp_uint_t *gc_pool_start = (void*)4;
STATIC
mp_uint_t
*
gc_pool_end
;
STATIC
int
gc_stack_overflow
;
STATIC
mp_uint_t
gc_stack
[
STACK_SIZE
];
STATIC
mp_uint_t
gc_stack
[
MICROPY_ALLOC_GC_
STACK_SIZE
];
STATIC
mp_uint_t
*
gc_sp
;
STATIC
uint16_t
gc_lock_depth
;
uint16_t
gc_auto_collect_enabled
;
...
...
@@ -196,7 +195,7 @@ bool gc_is_locked(void) {
if (ATB_GET_KIND(_block) == AT_HEAD) { \
/* an unmarked head, mark it, and push it on gc stack */
\
ATB_HEAD_TO_MARK(_block); \
if (gc_sp < &gc_stack[STACK_SIZE]) { \
if (gc_sp < &gc_stack[
MICROPY_ALLOC_GC_
STACK_SIZE]) { \
*gc_sp++ = _block; \
} else { \
gc_stack_overflow = 1; \
...
...
This diff is collapsed.
Click to expand it.
py/mpconfig.h
+
5
−
0
View file @
fd40a9c3
...
...
@@ -51,6 +51,11 @@
/*****************************************************************************/
/* Memory allocation policy */
// Number of words allocated (in BSS) to the GC stack (minimum is 1)
#ifndef MICROPY_ALLOC_GC_STACK_SIZE
#define MICROPY_ALLOC_GC_STACK_SIZE (64)
#endif
// Initial amount for lexer indentation level
#ifndef MICROPY_ALLOC_LEXER_INDENT_INIT
#define MICROPY_ALLOC_LEXER_INDENT_INIT (10)
...
...
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