From 1718cf5f8a39b922eba3ad1b3c9a9570188362b1 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 3 Apr 2022 11:16:39 +0100 Subject: 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 --- apps/tree.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'apps/tree.h') 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 { int name_buffer_handle; /* handle to the name cache */ int max_entries; /* Max entries in the cache */ int name_buffer_size; /* in bytes */ - volatile int lock_count; /* non-0 if buffers may not move */ }; struct browse_context { @@ -120,14 +119,10 @@ void browse_context_init(struct browse_context *browse, int rockbox_browse(struct browse_context *browse); int create_playlist(void); void resume_directory(const char *dir); -static inline void tree_lock_cache(struct tree_context *t) -{ - t->cache.lock_count++; -} -static inline void tree_unlock_cache(struct tree_context *t) -{ - t->cache.lock_count--; -} + +void tree_lock_cache(struct tree_context *t); +void tree_unlock_cache(struct tree_context *t); + #ifdef WIN32 /* it takes an int on windows */ #define getcwd_size_t int -- cgit v1.2.3