[core] mark some chunk.c funcs as pure

This commit is contained in:
Glenn Strauss 2020-01-21 21:01:05 -05:00
parent eae84b6a69
commit 1d6003e575
1 changed files with 4 additions and 0 deletions

View File

@ -43,12 +43,15 @@ void chunkqueue_set_tempdirs_default_reset (void)
}
/* chunk buffer (c->mem) is never NULL; specialize routines from buffer.h */
__attribute_pure__
static inline size_t chunk_buffer_string_length(const buffer *b) {
return 0 != b->used ? b->used - 1 : 0;
}
__attribute_pure__
static inline int chunk_buffer_string_is_empty(const buffer *b) {
return b->used < 2;
}
__attribute_pure__
static inline size_t chunk_buffer_string_space(const buffer *b) {
return b->size ? b->size - (b->used | (0 == b->used)) : 0;
}
@ -220,6 +223,7 @@ void chunkqueue_chunk_pool_free(void)
chunk_buffers = NULL;
}
__attribute_pure__
static off_t chunk_remaining_length(const chunk *c) {
/* MEM_CHUNK or FILE_CHUNK */
return (c->type == MEM_CHUNK