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
adf3cb50
Commit
adf3cb50
authored
8 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
extmod/modframebuf: Store underlying buffer object to prevent GC free.
parent
5e393007
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
extmod/modframebuf.c
+2
-0
2 additions, 0 deletions
extmod/modframebuf.c
with
2 additions
and
0 deletions
extmod/modframebuf.c
+
2
−
0
View file @
adf3cb50
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
typedef
struct
_mp_obj_framebuf_t
{
typedef
struct
_mp_obj_framebuf_t
{
mp_obj_base_t
base
;
mp_obj_base_t
base
;
mp_obj_t
buf_obj
;
// need to store this to prevent GC from reclaiming buf
void
*
buf
;
void
*
buf
;
uint16_t
width
,
height
,
stride
;
uint16_t
width
,
height
,
stride
;
uint8_t
format
;
uint8_t
format
;
...
@@ -133,6 +134,7 @@ STATIC mp_obj_t framebuf_make_new(const mp_obj_type_t *type, size_t n_args, size
...
@@ -133,6 +134,7 @@ STATIC mp_obj_t framebuf_make_new(const mp_obj_type_t *type, size_t n_args, size
mp_obj_framebuf_t
*
o
=
m_new_obj
(
mp_obj_framebuf_t
);
mp_obj_framebuf_t
*
o
=
m_new_obj
(
mp_obj_framebuf_t
);
o
->
base
.
type
=
type
;
o
->
base
.
type
=
type
;
o
->
buf_obj
=
args
[
0
];
mp_buffer_info_t
bufinfo
;
mp_buffer_info_t
bufinfo
;
mp_get_buffer_raise
(
args
[
0
],
&
bufinfo
,
MP_BUFFER_WRITE
);
mp_get_buffer_raise
(
args
[
0
],
&
bufinfo
,
MP_BUFFER_WRITE
);
...
...
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