codythegreat / dss

Dead Simple Slides - A terminal based presentation tool with Vim style keybindings
MIT License
54 stars 3 forks source link

Dynamic memory allocation for Slide.content #20

Closed codythegreat closed 4 years ago

codythegreat commented 4 years ago

Currently Slide.content is setup as a fixed length character array of 5000 characters. We'd prefer for this to be dynamic so that even if a slide exceeds 5000 characters we won't encounter a seg fault. We'd also like to small slides utilize less memory.

I believe that this can be accomplished by setting the Slide.content variable in parser.h as a character pointer char *content and then in parser.c we'd build the content with a character array of x*y size, then we'd simply point the Slide.content variable to the character array. We may also need to allocate the character array to heap memory instead of the stack.

codythegreat commented 4 years ago

I'm closing this issue as I was able to implement a much better solution that will make it much easier to add features in the future. Quick synopsis of changes below;