1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

More _scm.h refactoring

* libguile/foreign.c (ROUND_UP): Copy here.
* libguile/vm.c (SCM_NOINLINE): Move here, to the only file that uses
  it.
  (ROUND_UP): Copy here.
* libguile/_scm.h (ROUND_UP, SCM_NOINLINE): Remove.  Centralizing
  private definitions isn't bad, but _scm.h also includes a bunch of
  Guile API as well, and the include itself is poorly named.
This commit is contained in:
Andy Wingo 2018-06-17 19:10:52 +02:00
parent 5176db70ca
commit 5159a15306
3 changed files with 16 additions and 12 deletions

View file

@ -89,18 +89,6 @@
#include "libguile/strings.h"
/* Return the first integer greater than or equal to LEN such that
LEN % ALIGN == 0. Return LEN if ALIGN is zero. */
#define ROUND_UP(len, align) \
((align) ? (((len) - 1UL) | ((align) - 1UL)) + 1UL : (len))
#if (defined __GNUC__)
# define SCM_NOINLINE __attribute__ ((__noinline__))
#else
# define SCM_NOINLINE /* noinline */
#endif
#endif /* SCM__SCM_H */
/*

View file

@ -44,6 +44,11 @@
/* Return the first integer greater than or equal to LEN such that
LEN % ALIGN == 0. Return LEN if ALIGN is zero. */
#define ROUND_UP(len, align) \
((align) ? (((len) - 1UL) | ((align) - 1UL)) + 1UL : (len))
SCM_SYMBOL (sym_void, "void");
SCM_SYMBOL (sym_float, "float");
SCM_SYMBOL (sym_double, "double");

View file

@ -59,6 +59,12 @@
#include "libguile/vm.h"
#include "libguile/vm-builtins.h"
#if (defined __GNUC__)
# define SCM_NOINLINE __attribute__ ((__noinline__))
#else
# define SCM_NOINLINE /* noinline */
#endif
static int vm_default_engine = SCM_VM_REGULAR_ENGINE;
/* Unfortunately we can't snarf these: snarfed things are only loaded up from
@ -240,6 +246,11 @@ static void vm_dispatch_pop_continuation_hook
static void vm_dispatch_next_hook (struct scm_vm *vp) SCM_NOINLINE;
static void vm_dispatch_abort_hook (struct scm_vm *vp) SCM_NOINLINE;
/* Return the first integer greater than or equal to LEN such that
LEN % ALIGN == 0. Return LEN if ALIGN is zero. */
#define ROUND_UP(len, align) \
((align) ? (((len) - 1UL) | ((align) - 1UL)) + 1UL : (len))
static void
vm_dispatch_hook (struct scm_vm *vp, int hook_num,
union scm_vm_stack_element *argv, int n)