![]() ![]() ![]() The solution is to push a pointer to the temporary structure onto GCStack so that it will be marked during garbage collection. ![]() Now, if the corruption only occurs after a garbage collection it's probably due to an unprotected temporary structure. To debug this situation, turn off the call to gc() in repl(), by commenting out the line: gc(NULL, env) Īlso, turn on the printing of garbage collections, by uncommenting: #define printgcs For example, if your extension to uLisp is constructing a list, it's important to make sure that it doesn't get garbage collected while it is being constructed. Unpredictable corruptions are often the result of garbage collection having an effect on temporary Lisp structures. For example, to print the Lisp object arg to the serial output you can add a statement such as: printobject(arg, pserial) Debugging the effect of garbage collections Lisps garbage collector causes unpredictable pauses when my program runs. When writing your own extensions to uLisp it's useful to be able to print out Lisp objects at different points in the code. Provides practical advice for the construction of Common Lisp programs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |