summaryrefslogtreecommitdiff
path: root/lib/resource.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-12 19:51:36 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-12 19:57:52 +0100
commit1e11918c8c56e3505193f4e6426c1a34aaae3941 (patch)
treeac772653e293c9d4197824ed55d7c9b9d9487d6b /lib/resource.h
parentac48e72bf6f9f491824e2de59a035c93aab8f81b (diff)
Lib: Save/restore state for linpools
Also change linpool.current ptr to really point to thr current chunk.
Diffstat (limited to 'lib/resource.h')
-rw-r--r--lib/resource.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/resource.h b/lib/resource.h
index 761c6adc..d9d4bb8f 100644
--- a/lib/resource.h
+++ b/lib/resource.h
@@ -59,11 +59,18 @@ void mb_free(void *);
typedef struct linpool linpool;
+typedef struct lp_state {
+ void *current, *large;
+ byte *ptr;
+} lp_state;
+
linpool *lp_new(pool *, unsigned blk);
void *lp_alloc(linpool *, unsigned size); /* Aligned */
void *lp_allocu(linpool *, unsigned size); /* Unaligned */
void *lp_allocz(linpool *, unsigned size); /* With clear */
void lp_flush(linpool *); /* Free everything, but leave linpool */
+void lp_save(linpool *m, lp_state *p); /* Save state */
+void lp_restore(linpool *m, lp_state *p); /* Restore state */
extern const int lp_chunk_size;
#define LP_GAS 1024