slavapestov/factor — pull request #1132 by bjourne (2014-09-10 16:14:12+00:00)
Title: Callback heap

So I was looking at #1130 to see how it can be solved. It looks to me like the callbacks system isn't as well implemented as the other parts of the factor VM so I tried to refactor it a little.

First I made a new error for callback space overflow because Factor can work fine even if the callback heap is full. In a coming pr I want to add a word to reclaim callback heap space because there is no reason why you shouldn't be able to. :)

Then I made it use a free_list_allocator, which mirrors the behaviour of the code_heap with the exception that the callback_heap never can be compacted.

Then I added a (callback-room) primitive and surrounding code so that you can query the memory usage from Factor.