summaryrefslogtreecommitdiff
path: root/lib/resource.h
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2017-05-16 14:31:16 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2017-05-16 15:34:57 +0200
commit05d47bd53e71480f1b276bd895f1c25088201e48 (patch)
tree6d9c8169ed695d17c90972ae6dd163c45a3d82b1 /lib/resource.h
parentb880e3ffaea12c3231975157bc51b5f90a2f2433 (diff)
Linpool: default allocation size
Diffstat (limited to 'lib/resource.h')
-rw-r--r--lib/resource.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/resource.h b/lib/resource.h
index 1a0568b4..761c6adc 100644
--- a/lib/resource.h
+++ b/lib/resource.h
@@ -65,6 +65,11 @@ void *lp_allocu(linpool *, unsigned size); /* Unaligned */
void *lp_allocz(linpool *, unsigned size); /* With clear */
void lp_flush(linpool *); /* Free everything, but leave linpool */
+extern const int lp_chunk_size;
+#define LP_GAS 1024
+#define LP_GOOD_SIZE(x) (((x + LP_GAS - 1) & (~(LP_GAS - 1))) - lp_chunk_size)
+#define lp_new_default(p) lp_new(p, LP_GOOD_SIZE(LP_GAS*4))
+
/* Slabs */
typedef struct slab slab;