[python] Malloc the syntax-highlighting uPy heap

This commit is contained in:
Romain Goyet
2018-06-04 14:54:30 +02:00
committed by EmilieNumworks
parent 29cacbc44f
commit 6cd18cca89
2 changed files with 32 additions and 4 deletions

View File

@@ -15,14 +15,19 @@ public:
protected:
class ContentView : public TextArea::ContentView {
public:
ContentView(KDText::FontSize fontSize) : TextArea::ContentView(fontSize) {}
ContentView(KDText::FontSize fontSize);
~ContentView();
void clearRect(KDContext * ctx, KDRect rect) const override;
void drawLine(KDContext * ctx, int line, const char * text, size_t length, int fromColumn, int toColumn) const override;
KDRect dirtyRectFromCursorPosition(size_t index, bool lineBreak) const override;
private:
static constexpr size_t k_pythonHeapSize = 4096;
char * m_pythonHeap;
};
private:
const ContentView * nonEditableContentView() const override { return &m_contentView; }
ContentView m_contentView;
char * m_pythonHeap;
};
}