diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-04-03 11:16:39 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-16 14:50:39 +0100 |
commit | 1718cf5f8a39b922eba3ad1b3c9a9570188362b1 (patch) | |
tree | 4f6bf81cb4f382ca04856b98492289825133c5ae /apps/tree.h | |
parent | b16bae6fe624d30631bf83290e204197ab136c12 (diff) | |
download | rockbox-1718cf5f8a39b922eba3ad1b3c9a9570188362b1.tar.gz rockbox-1718cf5f8a39b922eba3ad1b3c9a9570188362b1.zip |
Convert a number of allocations to use buflib pinning
Several places in the codebase implemented an ad-hoc form of pinning;
they can be converted to use buflib pinning instead.
Change-Id: I4450be007e80f6c9cc9f56c2929fa4b9b85ebff3
Diffstat (limited to 'apps/tree.h')
-rw-r--r-- | apps/tree.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/apps/tree.h b/apps/tree.h index c70ae8dac1..a75e8d2260 100644 --- a/apps/tree.h +++ b/apps/tree.h | |||
@@ -52,7 +52,6 @@ struct tree_cache { | |||
52 | int name_buffer_handle; /* handle to the name cache */ | 52 | int name_buffer_handle; /* handle to the name cache */ |
53 | int max_entries; /* Max entries in the cache */ | 53 | int max_entries; /* Max entries in the cache */ |
54 | int name_buffer_size; /* in bytes */ | 54 | int name_buffer_size; /* in bytes */ |
55 | volatile int lock_count; /* non-0 if buffers may not move */ | ||
56 | }; | 55 | }; |
57 | 56 | ||
58 | struct browse_context { | 57 | struct browse_context { |
@@ -120,14 +119,10 @@ void browse_context_init(struct browse_context *browse, | |||
120 | int rockbox_browse(struct browse_context *browse); | 119 | int rockbox_browse(struct browse_context *browse); |
121 | int create_playlist(void); | 120 | int create_playlist(void); |
122 | void resume_directory(const char *dir); | 121 | void resume_directory(const char *dir); |
123 | static inline void tree_lock_cache(struct tree_context *t) | 122 | |
124 | { | 123 | void tree_lock_cache(struct tree_context *t); |
125 | t->cache.lock_count++; | 124 | void tree_unlock_cache(struct tree_context *t); |
126 | } | 125 | |
127 | static inline void tree_unlock_cache(struct tree_context *t) | ||
128 | { | ||
129 | t->cache.lock_count--; | ||
130 | } | ||
131 | #ifdef WIN32 | 126 | #ifdef WIN32 |
132 | /* it takes an int on windows */ | 127 | /* it takes an int on windows */ |
133 | #define getcwd_size_t int | 128 | #define getcwd_size_t int |