[cffi-devel] :pointer size on 64-bit OS's

Elliott Slaughter elliottslaughter at gmail.com
Thu May 27 07:04:05 UTC 2010


On Wed, May 26, 2010 at 11:44 PM, Luís Oliveira <luismbo at gmail.com> wrote:

> On Thu, May 27, 2010 at 2:31 AM, Daniel Herring <dherring at tentpost.com>
> wrote:
> >>> So my question is, on SBCL/32-bit & CCL/32-bit, what is the expected
> size
> >>> of :pointer on a 64-bit OS?
> [...]
> >  std::cout << sizeof(void *) <<"\n";
> [...]
> > prints "8".
>
> But that is coming from neither SBCL/CCL nor a 32-bit compiler. :-)


Yes, the size is 4 (see output below).

Again, this problem is only observable on 32-bit SBCL running on top of
64-bit Windows. This problem has never occurred on Linux or OS X or any
other OS. The problem cannot be reproduced on 32-bit versions of Windows.
The problem doesn't appear in Lispworks or CLISP. (CCL 32-bit doesn't run on
64-bit Windows.) I think I've managed to reproduce it in Allegro CL, but
only with optimize speed turned on, and I didn't get backtrace so I can't
really be sure. So unless you have a system that meets those parameters, you
probably won't be able to reproduce this bug.

* (foreign-type-size :pointer)

4

* *features*

(CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86 CFFI-FEATURES:WINDOWS :CFFI
 CFFI-SYS::FLAT-NAMESPACE :WINDOWS :LITTLE-ENDIAN :ASDF :ANSI-CL
:COMMON-LISP
 :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL
 :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86 :WIN32 :GENCGC
 :STACK-GROWS-DOWNWARD-NOT-UPWARD :C-STACK-IS-CONTROL-STACK
 :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP
:RAW-INSTANCE-INIT-VOPS
 :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :INLINE-CONSTANTS :LINKAGE-TABLE :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-PUTWC)

-- 
Elliott Slaughter

"Don't worry about what anybody else is going to do. The best way to predict
the future is to invent it." - Alan Kay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20100527/8d7e0d36/attachment.html>


More information about the cffi-devel mailing list