sort of compiles under macos now
This commit is contained in:
parent
11082997d8
commit
15a097a100
5 changed files with 37 additions and 34 deletions
|
@ -165,7 +165,7 @@ int main(int argc, char ** argv) {
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
srandom(tv.tv_usec);
|
srandom(tv.tv_usec);
|
||||||
if(!silent) {
|
if(!silent) {
|
||||||
printf("Seed: %ld\n", tv.tv_usec);
|
printf("Seed: %lld\n", (long long)tv.tv_usec);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
srandom(seed);
|
srandom(seed);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
SUBDIRS(lang)
|
SUBDIRS(lang)
|
||||||
ADD_LIBRARY(referential algebra.c dml.c ddl.c tuple.c lang/ast.c)
|
ADD_LIBRARY(referential algebra.c dml.c ddl.c tuple.c lang/ast.c)
|
||||||
|
TARGET_LINK_LIBRARIES(referential ${COMMON_LIBRARIES})
|
||||||
SET(COMMON_LIBRARIES referential refparse ${COMMON_LIBRARIES})
|
SET(COMMON_LIBRARIES referential refparse ${COMMON_LIBRARIES})
|
||||||
IF(CHECK_LIBRARY)
|
IF(CHECK_LIBRARY)
|
||||||
CREATE_CHECK_OPT(toplevel ${CMAKE_CURRENT_SOURCE_DIR}/test-script.ref)
|
CREATE_CHECK_OPT(toplevel ${CMAKE_CURRENT_SOURCE_DIR}/test-script.ref)
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
ADD_LIBRARY(pobj xmem.c debug.c hash.c queue.c pobj.c)
|
ADD_LIBRARY(pobj xmem.c debug.c hash.c queue.c pobj.c)
|
||||||
|
TARGET_LINK_LIBRARIES(pobj ${COMMON_LIBRARIES})
|
||||||
|
|
||||||
|
|
|
@ -15,67 +15,67 @@ typedef struct debug_impl {
|
||||||
|
|
||||||
static int debug_num_copies(stasis_handle_t * h) {
|
static int debug_num_copies(stasis_handle_t * h) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call num_copies(%lx)\n", pthread_self(), (unsigned long)hh); fflush(stdout);
|
printf("tid=%9ld call num_copies(%lx)\n", (intptr_t)pthread_self(), (unsigned long)hh); fflush(stdout);
|
||||||
int ret = hh->num_copies(hh);
|
int ret = hh->num_copies(hh);
|
||||||
printf("tid=%9ld retn num_copies(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn num_copies(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static int debug_num_copies_buffer(stasis_handle_t * h) {
|
static int debug_num_copies_buffer(stasis_handle_t * h) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call num_copies_buffer(%lx)\n", pthread_self(), (unsigned long)hh); fflush(stdout);
|
printf("tid=%9ld call num_copies_buffer(%lx)\n", (intptr_t)pthread_self(), (unsigned long)hh); fflush(stdout);
|
||||||
int ret = hh->num_copies_buffer(hh);
|
int ret = hh->num_copies_buffer(hh);
|
||||||
printf("tid=%9ld retn num_copies_buffer(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn num_copies_buffer(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static int debug_close(stasis_handle_t * h) {
|
static int debug_close(stasis_handle_t * h) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call close(%lx)\n", pthread_self(), (unsigned long)hh); fflush(stdout);
|
printf("tid=%9ld call close(%lx)\n", (intptr_t)pthread_self(), (unsigned long)hh); fflush(stdout);
|
||||||
int ret = hh->close(hh);
|
int ret = hh->close(hh);
|
||||||
printf("tid=%9ld retn close(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn close(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
free(h->impl);
|
free(h->impl);
|
||||||
free(h);
|
free(h);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static lsn_t debug_start_position(stasis_handle_t *h) {
|
static lsn_t debug_start_position(stasis_handle_t *h) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call start_position(%lx)\n", pthread_self(), (unsigned long)hh); fflush(stdout);
|
printf("tid=%9ld call start_position(%lx)\n", (intptr_t)pthread_self(), (unsigned long)hh); fflush(stdout);
|
||||||
int ret = hh->start_position(hh);
|
int ret = hh->start_position(hh);
|
||||||
printf("tid=%9ld retn start_position(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn start_position(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static lsn_t debug_end_position(stasis_handle_t *h) {
|
static lsn_t debug_end_position(stasis_handle_t *h) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call end_position(%lx)\n", pthread_self(), (unsigned long)hh); fflush(stdout);
|
printf("tid=%9ld call end_position(%lx)\n", (intptr_t)pthread_self(), (unsigned long)hh); fflush(stdout);
|
||||||
int ret = hh->end_position(hh);
|
int ret = hh->end_position(hh);
|
||||||
printf("tid=%9ld retn end_position(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn end_position(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static stasis_write_buffer_t * debug_write_buffer(stasis_handle_t * h,
|
static stasis_write_buffer_t * debug_write_buffer(stasis_handle_t * h,
|
||||||
lsn_t off, lsn_t len) {
|
lsn_t off, lsn_t len) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call write_buffer(%lx, %lld, %lld)\n",
|
printf("tid=%9ld call write_buffer(%lx, %lld, %lld)\n",
|
||||||
pthread_self(), (unsigned long)hh, off, len); fflush(stdout);
|
(intptr_t)pthread_self(), (unsigned long)hh, off, len); fflush(stdout);
|
||||||
stasis_write_buffer_t * ret = hh->write_buffer(hh,off,len);
|
stasis_write_buffer_t * ret = hh->write_buffer(hh,off,len);
|
||||||
stasis_write_buffer_t * retWrap = malloc(sizeof(stasis_write_buffer_t));
|
stasis_write_buffer_t * retWrap = malloc(sizeof(stasis_write_buffer_t));
|
||||||
*retWrap = *ret;
|
*retWrap = *ret;
|
||||||
retWrap->h = h;
|
retWrap->h = h;
|
||||||
retWrap->impl = ret;
|
retWrap->impl = ret;
|
||||||
printf("tid=%9ld retn write_buffer(%lx, %lld, %lld) = %lx\n",
|
printf("tid=%9ld retn write_buffer(%lx, %lld, %lld) = %lx\n",
|
||||||
pthread_self(), (unsigned long)hh, off, len, (unsigned long)retWrap); fflush(stdout);
|
(intptr_t)pthread_self(), (unsigned long)hh, off, len, (unsigned long)retWrap); fflush(stdout);
|
||||||
return retWrap;
|
return retWrap;
|
||||||
}
|
}
|
||||||
static stasis_write_buffer_t * debug_append_buffer(stasis_handle_t * h,
|
static stasis_write_buffer_t * debug_append_buffer(stasis_handle_t * h,
|
||||||
lsn_t len) {
|
lsn_t len) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call append_buffer(%lx, %lld)\n",
|
printf("tid=%9ld call append_buffer(%lx, %lld)\n",
|
||||||
pthread_self(), (unsigned long)hh, len); fflush(stdout);
|
(intptr_t)pthread_self(), (unsigned long)hh, len); fflush(stdout);
|
||||||
stasis_write_buffer_t * ret = hh->append_buffer(hh,len);
|
stasis_write_buffer_t * ret = hh->append_buffer(hh,len);
|
||||||
stasis_write_buffer_t * retWrap = malloc(sizeof(stasis_write_buffer_t));
|
stasis_write_buffer_t * retWrap = malloc(sizeof(stasis_write_buffer_t));
|
||||||
*retWrap = *ret;
|
*retWrap = *ret;
|
||||||
retWrap->h = h;
|
retWrap->h = h;
|
||||||
retWrap->impl = ret;
|
retWrap->impl = ret;
|
||||||
printf("tid=%9ld retn append_buffer(%lx, %lld) = %lx (off=%lld)\n",
|
printf("tid=%9ld retn append_buffer(%lx, %lld) = %lx (off=%lld)\n",
|
||||||
pthread_self(), (unsigned long)hh, len, (unsigned long)retWrap, ret->off); fflush(stdout);
|
(intptr_t)pthread_self(), (unsigned long)hh, len, (unsigned long)retWrap, ret->off); fflush(stdout);
|
||||||
return retWrap;
|
return retWrap;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -84,23 +84,23 @@ static int debug_release_write_buffer(stasis_write_buffer_t * w_wrap) {
|
||||||
stasis_handle_t * hh = w->h;
|
stasis_handle_t * hh = w->h;
|
||||||
|
|
||||||
// Debugging output adds a parameter, h, for convenience.
|
// Debugging output adds a parameter, h, for convenience.
|
||||||
printf("tid=%9ld call release_write_buffer(%lx, %lx)\n", pthread_self(), (unsigned long)hh, (unsigned long)w_wrap); fflush(stdout);
|
printf("tid=%9ld call release_write_buffer(%lx, %lx)\n", (intptr_t)pthread_self(), (unsigned long)hh, (unsigned long)w_wrap); fflush(stdout);
|
||||||
int ret = hh->release_write_buffer(w);
|
int ret = hh->release_write_buffer(w);
|
||||||
printf("tid=%9ld retn release_write_buffer(%lx, %lx) = %d\n", pthread_self(), (unsigned long)hh, (unsigned long)w_wrap, ret); fflush(stdout);
|
printf("tid=%9ld retn release_write_buffer(%lx, %lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, (unsigned long)w_wrap, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static stasis_read_buffer_t * debug_read_buffer(stasis_handle_t * h,
|
static stasis_read_buffer_t * debug_read_buffer(stasis_handle_t * h,
|
||||||
lsn_t off, lsn_t len) {
|
lsn_t off, lsn_t len) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call read_buffer(%lx, %lld, %lld)\n",
|
printf("tid=%9ld call read_buffer(%lx, %lld, %lld)\n",
|
||||||
pthread_self(), (unsigned long)hh, off, len); fflush(stdout);
|
(intptr_t)pthread_self(), (unsigned long)hh, off, len); fflush(stdout);
|
||||||
stasis_read_buffer_t * ret = hh->read_buffer(hh,off,len);
|
stasis_read_buffer_t * ret = hh->read_buffer(hh,off,len);
|
||||||
stasis_read_buffer_t * retWrap = malloc(sizeof(stasis_read_buffer_t));
|
stasis_read_buffer_t * retWrap = malloc(sizeof(stasis_read_buffer_t));
|
||||||
*retWrap = *ret;
|
*retWrap = *ret;
|
||||||
retWrap->h = h;
|
retWrap->h = h;
|
||||||
retWrap->impl = ret;
|
retWrap->impl = ret;
|
||||||
printf("tid=%9ld retn read_buffer(%lx, %lld, %lld) = %lx\n",
|
printf("tid=%9ld retn read_buffer(%lx, %lld, %lld) = %lx\n",
|
||||||
pthread_self(), (unsigned long)hh, off, len, (unsigned long)retWrap); fflush(stdout);
|
(intptr_t)pthread_self(), (unsigned long)hh, off, len, (unsigned long)retWrap); fflush(stdout);
|
||||||
return retWrap;
|
return retWrap;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -110,60 +110,60 @@ static int debug_release_read_buffer(stasis_read_buffer_t * r_wrap) {
|
||||||
stasis_handle_t * hh = r->h;
|
stasis_handle_t * hh = r->h;
|
||||||
|
|
||||||
// Debugging output adds a parameter, h, for convenience.
|
// Debugging output adds a parameter, h, for convenience.
|
||||||
printf("tid=%9ld call release_read_buffer(%lx, %lx)\n", pthread_self(), (unsigned long)hh, (unsigned long)r_wrap); fflush(stdout);
|
printf("tid=%9ld call release_read_buffer(%lx, %lx)\n", (intptr_t)pthread_self(), (unsigned long)hh, (unsigned long)r_wrap); fflush(stdout);
|
||||||
int ret = hh->release_read_buffer(r);
|
int ret = hh->release_read_buffer(r);
|
||||||
printf("tid=%9ld retn release_read_buffer(%lx, %lx) = %d\n", pthread_self(), (unsigned long)hh, (unsigned long)r_wrap, ret); fflush(stdout);
|
printf("tid=%9ld retn release_read_buffer(%lx, %lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, (unsigned long)r_wrap, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int debug_write(stasis_handle_t * h, lsn_t off,
|
static int debug_write(stasis_handle_t * h, lsn_t off,
|
||||||
const byte * dat, lsn_t len) {
|
const byte * dat, lsn_t len) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call write(%lx, %lld, %lx, %lld)\n", pthread_self(), (unsigned long)hh, off, (unsigned long)dat, len); fflush(stdout);
|
printf("tid=%9ld call write(%lx, %lld, %lx, %lld)\n", (intptr_t)pthread_self(), (unsigned long)hh, off, (unsigned long)dat, len); fflush(stdout);
|
||||||
int ret = hh->write(hh, off, dat, len);
|
int ret = hh->write(hh, off, dat, len);
|
||||||
printf("tid=%9ld retn write(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn write(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static int debug_append(stasis_handle_t * h, lsn_t * off,
|
static int debug_append(stasis_handle_t * h, lsn_t * off,
|
||||||
const byte * dat, lsn_t len) {
|
const byte * dat, lsn_t len) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call append(%lx, ??, %lx, %lld)\n", pthread_self(), (unsigned long)hh, (unsigned long)dat, len); fflush(stdout);
|
printf("tid=%9ld call append(%lx, ??, %lx, %lld)\n", (intptr_t)pthread_self(), (unsigned long)hh, (unsigned long)dat, len); fflush(stdout);
|
||||||
lsn_t tmpOff;
|
lsn_t tmpOff;
|
||||||
if(!off) {
|
if(!off) {
|
||||||
off = &tmpOff;
|
off = &tmpOff;
|
||||||
}
|
}
|
||||||
int ret = hh->append(hh, off, dat, len);
|
int ret = hh->append(hh, off, dat, len);
|
||||||
printf("tid=%9ld retn append(%lx, %lld, %lx, %lld) = %d\n", pthread_self(), (unsigned long)hh, *off, (unsigned long) dat, len, ret); fflush(stdout);
|
printf("tid=%9ld retn append(%lx, %lld, %lx, %lld) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, *off, (unsigned long) dat, len, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
static int debug_read(stasis_handle_t * h,
|
static int debug_read(stasis_handle_t * h,
|
||||||
lsn_t off, byte * buf, lsn_t len) {
|
lsn_t off, byte * buf, lsn_t len) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call read(%lx, %lld, %lx, %lld)\n", pthread_self(), (unsigned long)hh, off, (unsigned long)buf, len); fflush(stdout);
|
printf("tid=%9ld call read(%lx, %lld, %lx, %lld)\n", (intptr_t)pthread_self(), (unsigned long)hh, off, (unsigned long)buf, len); fflush(stdout);
|
||||||
int ret = hh->read(hh, off, buf, len);
|
int ret = hh->read(hh, off, buf, len);
|
||||||
printf("tid=%9ld retn read(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn read(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static int debug_force(stasis_handle_t *h) {
|
static int debug_force(stasis_handle_t *h) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call force(%lx)\n", pthread_self(), (unsigned long)hh); fflush(stdout);
|
printf("tid=%9ld call force(%lx)\n", (intptr_t)pthread_self(), (unsigned long)hh); fflush(stdout);
|
||||||
int ret = hh->force(hh);
|
int ret = hh->force(hh);
|
||||||
printf("tid=%9ld retn force(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn force(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static int debug_force_range(stasis_handle_t *h, lsn_t start, lsn_t stop) {
|
static int debug_force_range(stasis_handle_t *h, lsn_t start, lsn_t stop) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call force(%lx,%lld,%lld)\n", pthread_self(), (unsigned long)hh, start, stop); fflush(stdout);
|
printf("tid=%9ld call force(%lx,%lld,%lld)\n", (intptr_t)pthread_self(), (unsigned long)hh, start, stop); fflush(stdout);
|
||||||
int ret = hh->force_range(hh, start, stop);
|
int ret = hh->force_range(hh, start, stop);
|
||||||
printf("tid=%9ld retn force(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn force(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static int debug_truncate_start(stasis_handle_t * h, lsn_t new_start) {
|
static int debug_truncate_start(stasis_handle_t * h, lsn_t new_start) {
|
||||||
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
stasis_handle_t * hh = ((debug_impl*)h->impl)->h;
|
||||||
printf("tid=%9ld call truncate_start(%lx, %lld)\n", pthread_self(), (unsigned long)hh, new_start); fflush(stdout);
|
printf("tid=%9ld call truncate_start(%lx, %lld)\n", (intptr_t)pthread_self(), (unsigned long)hh, new_start); fflush(stdout);
|
||||||
int ret = hh->truncate_start(hh, new_start);
|
int ret = hh->truncate_start(hh, new_start);
|
||||||
printf("tid=%9ld retn truncate_start(%lx) = %d\n", pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
printf("tid=%9ld retn truncate_start(%lx) = %d\n", (intptr_t)pthread_self(), (unsigned long)hh, ret); fflush(stdout);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -636,7 +636,7 @@ void TlsmFree(int xid, recordid tree, lsm_page_deallocator_t dealloc,
|
||||||
Tdealloc(xid, *(recordid*)allocator_state);
|
Tdealloc(xid, *(recordid*)allocator_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const recordid lsmLookup(int xid, Page *node, int depth,
|
static recordid lsmLookup(int xid, Page *node, int depth,
|
||||||
const byte *key, size_t keySize, lsm_comparator_t cmp) {
|
const byte *key, size_t keySize, lsm_comparator_t cmp) {
|
||||||
|
|
||||||
if(*recordcount_ptr(node) == FIRST_SLOT) {
|
if(*recordcount_ptr(node) == FIRST_SLOT) {
|
||||||
|
|
Loading…
Reference in a new issue