projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean up some #defines
[blerg.git]
/
database.c
diff --git
a/database.c
b/database.c
index
c3ac954
..
4b16d32
100644
(file)
--- a/
database.c
+++ b/
database.c
@@
-11,8
+11,6
@@
#include "database.h"
#include "config.h"
#include "database.h"
#include "config.h"
-#define RECORDS_PER_SEGMENT 65536
-
uint64_t blerg_get_record_count(struct blerg *blerg) {
uint64_t count;
flock(blerg->meta_fd, LOCK_SH);
uint64_t blerg_get_record_count(struct blerg *blerg) {
uint64_t count;
flock(blerg->meta_fd, LOCK_SH);
@@
-101,7
+99,7
@@
int blerg_segment_switch(struct blerg *blerg, int new_segment) {
open_failed_data_mmap:
close(blerg->data_fd);
open_failed_data_open:
open_failed_data_mmap:
close(blerg->data_fd);
open_failed_data_open:
- munmap((void *)blerg->index, sizeof(
65536
* sizeof(struct record)));
+ munmap((void *)blerg->index, sizeof(
RECORDS_PER_SEGMENT
* sizeof(struct record)));
open_failed_index_mmap:
close(blerg->index_fd);
open_failed_index_open:
open_failed_index_mmap:
close(blerg->index_fd);
open_failed_index_open:
@@
-203,7
+201,7
@@
int blerg_close(struct blerg *blerg) {
}
int blerg_store(struct blerg *blerg, const char *data, int len) {
}
int blerg_store(struct blerg *blerg, const char *data, int len) {
- if (len >
65536
) {
+ if (len >
MAX_RECORD_SIZE
) {
printf("len > 64K\n");
return -1;
}
printf("len > 64K\n");
return -1;
}