Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lispworks patches to lmdb.lisp #12

Open
dbmcclain opened this issue Feb 23, 2021 · 0 comments
Open

Lispworks patches to lmdb.lisp #12

dbmcclain opened this issue Feb 23, 2021 · 0 comments

Comments

@dbmcclain
Copy link

dbmcclain commented Feb 23, 2021

To make the file compile properly in Lispworks:

  1. During checking and assigment of constant +n-alignment-bits+
#+(and 64-bit lispworks)
(eval-when (:compile-toplevel :load-toplevel :load-toplevel)
  (assert (typep (1- (expt 2 64)) '(unsigned-byte 64)))
  (assert (typep (ash (1- (expt 2 64)) -4) 'fixnum))
  (alexandria:define-constant +n-word-bits+ 64)
  (alexandria:define-constant +n-alignment-bits+ 4))
#+(and 64-bit (not lispworks))
(eval-when (:compile-toplevel :load-toplevel :load-toplevel)
  (assert (typep (1- (expt 2 64)) '(unsigned-byte 64)))
  (assert (typep (ash (1- (expt 2 64)) -3) 'fixnum))
  (alexandria:define-constant +n-word-bits+ 64)
  (alexandria:define-constant +n-alignment-bits+ 3))

It is probably okay to just default to using 4 bits shifting for all cases, since 16-bytes is a unit of alignment in a 64-bit machine, for all allocators that I am aware of.

  1. And to prevent a spurious error report during checking that WITHOUT-INTERRUPTS exists, the entire block of defmacros for WITHOUT-INTERRUPTS needs to be enclosed within (EVAL-WHEN (... all situations) ...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant