Kerfuffle 2 лет назад
Родитель
Сommit
2bdc09646d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      ggml.c

+ 1 - 1
ggml.c

@@ -4411,7 +4411,7 @@ void ggml_free(struct ggml_context * ctx) {
 }
 
 size_t ggml_used_mem(const struct ggml_context * ctx) {
-    return ctx->objects_end->offs + ctx->objects_end->size;
+    return ctx->objects_end == NULL ? 0 : ctx->objects_end->offs + ctx->objects_end->size;
 }
 
 size_t ggml_set_scratch(struct ggml_context * ctx, struct ggml_scratch scratch) {