diff options
| author | Jeff Epler <jepler@gmail.com> | 2020-04-13 08:51:35 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2020-04-14 18:24:59 -0500 |
| commit | 880fff80e904ef4b173d551742b7acde56114f0c (patch) | |
| tree | 9942c0427cc31bb08f299123e4abb80416b5e7f2 /shared-module/_protomatter/allocator.h | |
| parent | 5d328c3b449dbd0eaf40c2edc205fb7c5d381589 (diff) | |
protomatter: Respond to review comments
- rename oe_pin -> output_enable_pin
- improve and reorganize docstrings
- rename swapbuffers->refresh
- rename "paused" -> "brightness", change semantics slightly
- common_hal several functions
- clarify why the common_hal routines can't be used directly in the
protocol's function pointers
- whitespace cleanups
- remove prototypes for nonexistent functions
Diffstat (limited to 'shared-module/_protomatter/allocator.h')
| -rw-r--r-- | shared-module/_protomatter/allocator.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shared-module/_protomatter/allocator.h b/shared-module/_protomatter/allocator.h index 1ae127de2..b7f517ce5 100644 --- a/shared-module/_protomatter/allocator.h +++ b/shared-module/_protomatter/allocator.h @@ -13,14 +13,14 @@ static inline void *_PM_allocator_impl(size_t sz) { if (gc_alloc_possible()) { return m_malloc(sz + sizeof(void*), true); } else { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); + supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); return allocation ? allocation->ptr : NULL; } } static inline void _PM_free_impl(void *ptr_in) { supervisor_allocation *allocation = allocation_from_ptr(ptr_in); - + if (allocation) { free_memory(allocation); } |
