Beispiel #1
0
static void global_environment_asserts()
{
     void *stack_start = sys_get_stack_start();

     /* The stack grows downwards, so the stack_start variable should be lower
      * in memory than the start of the stack */
     assert((void *)(&stack_start) < stack_start);

     /* An LObject is the size of four pointers (lref_t's) */
     assert(sizeof(struct lobject_t) == 4 * sizeof(lref_t));
}
Beispiel #2
0
lref_t lset_stack_limit(lref_t amount)
{
     size_t new_size_limit = 0;
     if (!NULLP(amount) && !FALSEP(amount))
          new_size_limit = get_c_long(amount);

     void *new_limit_obj = sys_set_stack_limit(new_size_limit);

     if (!new_size_limit)
     {
          dscwritef(DF_SHOW_GC, ("stack limit disabled!"));

          return boolcons(false);
     }

     dscwritef(DF_SHOW_GC, ("stack_size = ~cd bytes, [~c&,~c&]\n",
                            new_size_limit,
                            new_limit_obj,
                            sys_get_stack_start()));

     return fixcons(new_size_limit);
}