Skip to content

Commit

Permalink
changed all pointers and size_t to 64 bit erlang side, according to s…
Browse files Browse the repository at this point in the history
…pec by dangud, needed to update set_kernel_arg with some cases to make it work
  • Loading branch information
tonyrog committed Jul 8, 2010
1 parent f220bcd commit 01ac058
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 82 deletions.
8 changes: 4 additions & 4 deletions c_src/Makefile
Expand Up @@ -130,18 +130,18 @@ all: all32 all64
nif32: config.32.h
$(MAKE) nif TYPE=release WORDSIZE=32

all32: config.32.h
all32: config.32.build
$(MAKE) driver TYPE=release WORDSIZE=32
$(MAKE) driver TYPE=debug WORDSIZE=32

all64: config.64.h
all64: config.64.build
$(MAKE) driver TYPE=release WORDSIZE=64
$(MAKE) driver TYPE=debug WORDSIZE=64

config.32.h: configure
config.32.build: configure
./configure --with-wordsize=32

config.64.h: configure
config.64.build: configure
./configure --with-wordsize=64

configure: configure.in
Expand Down
6 changes: 4 additions & 2 deletions c_src/cbufv2.h
Expand Up @@ -88,8 +88,9 @@ typedef struct
#define TUPLE_END 22 // tuple end
#define ENUM 23 // Encoded as INT32
#define BITFIELD 24 // Encoded as UINT64
#define HANDLE 25 // Encoded pointer 32/64 bit

#define HANDLE 25 // Encoded pointer 64 bit
#define POINTER 26 // Always coded as UINT64
#define USIZE 27 // size_t - Encoded as 64bit
// External Term Format (ETF)
// Version 131
#ifdef CBUF_USE_PUT_ETF
Expand Down Expand Up @@ -685,6 +686,7 @@ static inline size_t cbuf_sizeof(u_int8_t tag)
case ENUM: return sizeof(int32_t);
case BITFIELD: return sizeof(int64_t);
case HANDLE: return sizeof(intptr_t);
case POINTER: return sizeof(u_int64_t);
default: return 0;
}
}
Expand Down

0 comments on commit 01ac058

Please sign in to comment.