diff options
| author | microDev <70126934+microDev1@users.noreply.github.com> | 2021-03-15 19:27:36 +0530 |
|---|---|---|
| committer | microDev <70126934+microDev1@users.noreply.github.com> | 2021-03-15 19:27:36 +0530 |
| commit | a52eb88031620a81521b937f2a0651dbac2bb350 (patch) | |
| tree | 017cbf8f686b252241182ef61ce48e8457aa1577 /shared-module/memorymonitor | |
| parent | 090b6ba42fcdfbb16844f77892087f91aa6ea201 (diff) | |
run code formatting script
Diffstat (limited to 'shared-module/memorymonitor')
| -rw-r--r-- | shared-module/memorymonitor/AllocationAlarm.c | 14 | ||||
| -rw-r--r-- | shared-module/memorymonitor/AllocationAlarm.h | 4 | ||||
| -rw-r--r-- | shared-module/memorymonitor/AllocationSize.c | 18 | ||||
| -rw-r--r-- | shared-module/memorymonitor/AllocationSize.h | 4 |
4 files changed, 20 insertions, 20 deletions
diff --git a/shared-module/memorymonitor/AllocationAlarm.c b/shared-module/memorymonitor/AllocationAlarm.c index 35f4e4c63..473a19396 100644 --- a/shared-module/memorymonitor/AllocationAlarm.c +++ b/shared-module/memorymonitor/AllocationAlarm.c @@ -31,17 +31,17 @@ #include "py/mpstate.h" #include "py/runtime.h" -void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocationalarm_obj_t* self, size_t minimum_block_count) { +void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocationalarm_obj_t *self, size_t minimum_block_count) { self->minimum_block_count = minimum_block_count; self->next = NULL; self->previous = NULL; } -void common_hal_memorymonitor_allocationalarm_set_ignore(memorymonitor_allocationalarm_obj_t* self, mp_int_t count) { +void common_hal_memorymonitor_allocationalarm_set_ignore(memorymonitor_allocationalarm_obj_t *self, mp_int_t count) { self->count = count; } -void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self) { +void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t *self) { // Check to make sure we aren't already paused. We can be if we're exiting from an exception we // caused. if (self->previous == NULL) { @@ -52,12 +52,12 @@ void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalar self->previous = NULL; } -void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationalarm_obj_t* self) { +void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationalarm_obj_t *self) { if (self->previous != NULL) { mp_raise_RuntimeError(translate("Already running")); } self->next = MP_STATE_VM(active_allocationalarms); - self->previous = (memorymonitor_allocationalarm_obj_t**) &MP_STATE_VM(active_allocationalarms); + self->previous = (memorymonitor_allocationalarm_obj_t **)&MP_STATE_VM(active_allocationalarms); if (self->next != NULL) { self->next->previous = &self->next; } @@ -65,11 +65,11 @@ void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationala } void memorymonitor_allocationalarms_allocation(size_t block_count) { - memorymonitor_allocationalarm_obj_t* alarm = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationalarms)); + memorymonitor_allocationalarm_obj_t *alarm = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationalarms)); size_t alert_count = 0; while (alarm != NULL) { // Hold onto next in case we remove the alarm from the list. - memorymonitor_allocationalarm_obj_t* next = alarm->next; + memorymonitor_allocationalarm_obj_t *next = alarm->next; if (block_count >= alarm->minimum_block_count) { if (alarm->count > 0) { alarm->count--; diff --git a/shared-module/memorymonitor/AllocationAlarm.h b/shared-module/memorymonitor/AllocationAlarm.h index 172c24f6c..1f6e3d069 100644 --- a/shared-module/memorymonitor/AllocationAlarm.h +++ b/shared-module/memorymonitor/AllocationAlarm.h @@ -41,8 +41,8 @@ typedef struct _memorymonitor_allocationalarm_obj_t { size_t minimum_block_count; mp_int_t count; // Store the location that points to us so we can remove ourselves. - memorymonitor_allocationalarm_obj_t** previous; - memorymonitor_allocationalarm_obj_t* next; + memorymonitor_allocationalarm_obj_t **previous; + memorymonitor_allocationalarm_obj_t *next; } memorymonitor_allocationalarm_obj_t; void memorymonitor_allocationalarms_allocation(size_t block_count); diff --git a/shared-module/memorymonitor/AllocationSize.c b/shared-module/memorymonitor/AllocationSize.c index c28e65592..42fae3b06 100644 --- a/shared-module/memorymonitor/AllocationSize.c +++ b/shared-module/memorymonitor/AllocationSize.c @@ -30,50 +30,50 @@ #include "py/mpstate.h" #include "py/runtime.h" -void common_hal_memorymonitor_allocationsize_construct(memorymonitor_allocationsize_obj_t* self) { +void common_hal_memorymonitor_allocationsize_construct(memorymonitor_allocationsize_obj_t *self) { common_hal_memorymonitor_allocationsize_clear(self); self->next = NULL; self->previous = NULL; } -void common_hal_memorymonitor_allocationsize_pause(memorymonitor_allocationsize_obj_t* self) { +void common_hal_memorymonitor_allocationsize_pause(memorymonitor_allocationsize_obj_t *self) { *self->previous = self->next; self->next = NULL; self->previous = NULL; } -void common_hal_memorymonitor_allocationsize_resume(memorymonitor_allocationsize_obj_t* self) { +void common_hal_memorymonitor_allocationsize_resume(memorymonitor_allocationsize_obj_t *self) { if (self->previous != NULL) { mp_raise_RuntimeError(translate("Already running")); } self->next = MP_STATE_VM(active_allocationsizes); - self->previous = (memorymonitor_allocationsize_obj_t**) &MP_STATE_VM(active_allocationsizes); + self->previous = (memorymonitor_allocationsize_obj_t **)&MP_STATE_VM(active_allocationsizes); if (self->next != NULL) { self->next->previous = &self->next; } MP_STATE_VM(active_allocationsizes) = self; } -void common_hal_memorymonitor_allocationsize_clear(memorymonitor_allocationsize_obj_t* self) { +void common_hal_memorymonitor_allocationsize_clear(memorymonitor_allocationsize_obj_t *self) { for (size_t i = 0; i < ALLOCATION_SIZE_BUCKETS; i++) { self->buckets[i] = 0; } } -uint16_t common_hal_memorymonitor_allocationsize_get_len(memorymonitor_allocationsize_obj_t* self) { +uint16_t common_hal_memorymonitor_allocationsize_get_len(memorymonitor_allocationsize_obj_t *self) { return ALLOCATION_SIZE_BUCKETS; } -size_t common_hal_memorymonitor_allocationsize_get_bytes_per_block(memorymonitor_allocationsize_obj_t* self) { +size_t common_hal_memorymonitor_allocationsize_get_bytes_per_block(memorymonitor_allocationsize_obj_t *self) { return BYTES_PER_BLOCK; } -uint16_t common_hal_memorymonitor_allocationsize_get_item(memorymonitor_allocationsize_obj_t* self, int16_t index) { +uint16_t common_hal_memorymonitor_allocationsize_get_item(memorymonitor_allocationsize_obj_t *self, int16_t index) { return self->buckets[index]; } void memorymonitor_allocationsizes_track_allocation(size_t block_count) { - memorymonitor_allocationsize_obj_t* as = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationsizes)); + memorymonitor_allocationsize_obj_t *as = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationsizes)); size_t power_of_two = 0; block_count >>= 1; while (block_count != 0) { diff --git a/shared-module/memorymonitor/AllocationSize.h b/shared-module/memorymonitor/AllocationSize.h index 3baab2213..3af1a1a3a 100644 --- a/shared-module/memorymonitor/AllocationSize.h +++ b/shared-module/memorymonitor/AllocationSize.h @@ -40,8 +40,8 @@ typedef struct _memorymonitor_allocationsize_obj_t { mp_obj_base_t base; uint16_t buckets[ALLOCATION_SIZE_BUCKETS]; // Store the location that points to us so we can remove ourselves. - memorymonitor_allocationsize_obj_t** previous; - memorymonitor_allocationsize_obj_t* next; + memorymonitor_allocationsize_obj_t **previous; + memorymonitor_allocationsize_obj_t *next; bool paused; } memorymonitor_allocationsize_obj_t; |
