Commit Graph

13 Commits

Author SHA1 Message Date
Timon a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00
Scott Shawcroft 76033d5115
Merge MicroPython v1.11 into CircuitPython 2021-04-26 15:47:41 -07:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Scott Shawcroft 274cb597b0
Remove debug extern 2020-03-03 10:55:50 -08:00
Scott Shawcroft 86fd93bd03
Support importing native modules in native packages.
This only fixes the `import` portion. It doesn't actually change
reference behavior because modules within a package could already
be referenced through the parent package even though an error should
have been thrown.
2020-02-25 15:32:55 -08:00
David Grimes f13ba7e8d9 * only make objects long lived if they are on the GC heap 2019-11-22 13:47:13 -05:00
Scott Shawcroft 5555a24479
Never long live the main dictionary.
It's contents change often and may be referenced elsewhere.

Fixes #1443
2019-02-01 16:05:37 -08:00
Scott Shawcroft 1ffb0a714f
Merge remote-tracking branch 'adafruit/3.x' into import_merge 2018-07-25 11:49:18 -07:00
Dan Halbert be1d882a8b Prevent repetitive recursive scanning of dicts when making them long-lived 2018-07-19 15:19:21 -04:00
Scott Shawcroft 252aacdddf
Analysis fixes and long lived tweaks. 2018-07-03 05:45:50 -07:00
Jeff Epler 922b7c3131 Don't assume the type of the prop->proxy objects
This fixes a crash running the cpydiff/core_class_superproperty.py
test, but it does not fix the difference to cpython3.

Closes: #705
2018-03-25 15:11:30 -05:00
Scott Shawcroft aa0ce98b3e Fix the initial state and polish a couple comments. 2018-01-24 14:13:26 -08:00
Scott Shawcroft 416abe33ed Introduce a long lived section of the heap.
This adapts the allocation process to start from either end of the heap
when searching for free space. The default behavior is identical to the
existing behavior where it starts with the lowest block and looks higher.
Now it can also look from the highest block and lower depending on the
long_lived parameter to gc_alloc. As the heap fills, the two sections may
overlap. When they overlap, a collect may be triggered in order to keep
the long lived section compact. However, free space is always eligable
for each type of allocation.

By starting from either of the end of the heap we have ability to separate
short lived objects from long lived ones. This separation reduces heap
fragmentation because long lived objects are easy to densely pack.

Most objects are short lived initially but may be made long lived when
they are referenced by a type or module. This involves copying the
memory and then letting the collect phase free the old portion.

QSTR pools and chunks are always long lived because they are never freed.

The reallocation, collection and free processes are largely unchanged. They
simply also maintain an index to the highest free block as well as the lowest.
These indices are used to speed up the allocation search until the next collect.

In practice, this change may slightly slow down import statements with the
benefit that memory is much less fragmented afterwards. For example, a test
import into a 20k heap that leaves ~6k free previously had the largest
continuous free space of ~400 bytes. After this change, the largest continuous
free space is over 3400 bytes.
2018-01-24 10:33:46 -08:00