Skip to content

Commit 2bdc096

Browse files
authored
ggml : fix ggml_used_mem() (#1264)
1 parent 70269ca commit 2bdc096

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4411,7 +4411,7 @@ void ggml_free(struct ggml_context * ctx) {
44114411
}
44124412

44134413
size_t ggml_used_mem(const struct ggml_context * ctx) {
4414-
return ctx->objects_end->offs + ctx->objects_end->size;
4414+
return ctx->objects_end == NULL ? 0 : ctx->objects_end->offs + ctx->objects_end->size;
44154415
}
44164416

44174417
size_t ggml_set_scratch(struct ggml_context * ctx, struct ggml_scratch scratch) {

0 commit comments

Comments
 (0)