Skip to content

Commit 37adc9c

Browse files
authored
ggml, llama : use defaulted constructors/destructors (#17649)
1 parent 16cc3c6 commit 37adc9c

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

ggml/src/gguf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ void gguf_set_tensor_data(struct gguf_context * ctx, const char * name, const vo
11691169
struct gguf_writer_base {
11701170
size_t written_bytes {0u};
11711171

1172-
~gguf_writer_base(void) {}
1172+
~gguf_writer_base(void) = default;
11731173

11741174
// we bet on devirtualization
11751175
virtual void write(int8_t val) = 0;

src/llama-impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void llama_log_callback_default(ggml_log_level level, const char * text, void *
3737
template <typename T>
3838
struct no_init {
3939
T value;
40-
no_init() { /* do nothing */ }
40+
no_init() = default;
4141
};
4242

4343
struct time_meas {

src/llama-model.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ static buft_list_t make_gpu_buft_list(ggml_backend_dev_t dev, llama_split_mode s
423423
}
424424

425425
struct llama_model::impl {
426-
impl() {}
427-
~impl() {}
426+
impl() = default;
427+
~impl() = default;
428428

429429
uint64_t n_elements = 0;
430430

@@ -461,7 +461,7 @@ llama_model::llama_model(const llama_model_params & params) : params(params), pi
461461
pimpl->has_tensor_overrides = params.tensor_buft_overrides && params.tensor_buft_overrides[0].pattern;
462462
}
463463

464-
llama_model::~llama_model() {}
464+
llama_model::~llama_model() = default;
465465

466466
void llama_model::load_stats(llama_model_loader & ml) {
467467
pimpl->n_elements = ml.n_elements;

src/llama-vocab.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3253,8 +3253,7 @@ void llama_vocab::impl::print_info() const {
32533253
llama_vocab::llama_vocab() : pimpl(new impl(*this)) {
32543254
}
32553255

3256-
llama_vocab::~llama_vocab() {
3257-
}
3256+
llama_vocab::~llama_vocab() = default;
32583257

32593258
void llama_vocab::load(llama_model_loader & ml, const LLM_KV & kv) {
32603259
pimpl->load(ml, kv);

0 commit comments

Comments
 (0)