Search found 6 matches

by Codingfragments
Mon Jan 04, 2021 4:25 pm
Forum: Development of MicroPython
Topic: M_new in external C Module, How to protect from GC.collect()
Replies: 10
Views: 4679

Re: M_new in external C Module, How to protect from GC.collect()

Yeah, I search for some, didn't find that one. After all, it was for good, the last 2 Days told me a lot about the memory management details, c-modules and the c++ wrapper :). So it was very well invested time. I also found out that my C Skills are a bit Rusty ( :( ) So I'm not sure how good the cod...
by Codingfragments
Mon Jan 04, 2021 2:45 pm
Forum: Development of MicroPython
Topic: M_new in external C Module, How to protect from GC.collect()
Replies: 10
Views: 4679

Re: M_new in external C Module, How to protect from GC.collect()

Good one, and i was slightly off :) I did some experiments on the esp32 heap Heap summary for capabilities 0x00000004: At 0x3ffaff10 len 240 free 4 allocated 164 min_free 4 largest_free_block 4 alloc_blocks 9 free_blocks 1 total_blocks 10 At 0x3ffb6388 len 7288 free 0 allocated 7168 min_free 0 large...
by Codingfragments
Mon Jan 04, 2021 10:35 am
Forum: Development of MicroPython
Topic: M_new in external C Module, How to protect from GC.collect()
Replies: 10
Views: 4679

Re: M_new in external C Module, How to protect from GC.collect()

Thanks a lot for your Answer. I also spend some time last night (actualy 6 hours straight) digging into the Micropython src code. That exercise and your answer have been great fun and i learned a lot about the actual GC implementation in Micropython. My current approach was to ditch the C++ implemen...
by Codingfragments
Sat Jan 02, 2021 11:42 am
Forum: Development of MicroPython
Topic: M_new in external C Module, How to protect from GC.collect()
Replies: 10
Views: 4679

Re: M_new in external C Module, How to protect from GC.collect()

My Current Code uses some wrappers to map a C++ class to a Python object, this works great. But in the constructor I create a memory block (using m_new(char,1024) ) Has been a while since I looked into the details, but IIRC if the pointer to that memory is a member of the MicroPython object should ...
by Codingfragments
Sat Jan 02, 2021 11:39 am
Forum: Development of MicroPython
Topic: M_new in external C Module, How to protect from GC.collect()
Replies: 10
Views: 4679

Re: M_new in external C Module, How to protect from GC.collect()

Thanks for your reply. In my case I'm developing for the ESP32 port which doesn't have a nativ malloc function and all memory is taking from the combined heap, which includes all python heap as well. I don't think the C++ part is the main issue here, more importantly, I like to understand how to sto...
by Codingfragments
Fri Jan 01, 2021 7:36 pm
Forum: Development of MicroPython
Topic: M_new in external C Module, How to protect from GC.collect()
Replies: 10
Views: 4679

M_new in external C Module, How to protect from GC.collect()

Hi I currently try to develop a C/C++ based extension Module which needs to create some dynamic memory Buffers. After switching to the master branch which allowed me to use some C++ Code I’m making good progress but I currently seek the best way to link my dynamic buffers (char[] with flexible sizes...