[e90b2f]: src / h / cache.h Maximize Restore History

Download this file

cache.h    48 lines (37 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* -*- mode: c; c-basic-offset: 8 -*- */
/*
cache.h -- thread-local cache for a variety of operations
*/
/*
Copyright (c) 2011, Juan Jose Garcia Ripoll.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
See file '../Copyright' for full details.
*/
#ifndef ECL_CACHE_H
#define ECL_CACHE_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ecl_cache {
cl_object keys;
cl_object table;
cl_index generation;
#ifdef ECL_THREADS
cl_object clear_list;
#endif
} *ecl_cache_ptr;
typedef struct ecl_cache_record {
cl_object key; /* vector[ndx] */
cl_object value; /* vector[ndx+1] */
cl_object gen; /* vector[ndx+2] */
} *ecl_cache_record_ptr;
extern ecl_cache_ptr ecl_make_cache(cl_index key_size, cl_index cache_size);
extern ecl_cache_record_ptr ecl_search_cache(ecl_cache_ptr cache);
extern void ecl_cache_remove_one(ecl_cache_ptr cache, cl_object first_key);
#ifdef __cplusplus
}
#endif
#endif /* !ECL_CACHE_H */