From ceeb33a5ef84d1a783f24441298a51eaf383594f Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 8 Jun 2012 21:13:14 +0400 Subject: [PATCH] Add comment in GC_memalign * mallocx.c (GC_memalign): Add comment for GC_malloc invocation result. --- mallocx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mallocx.c b/mallocx.c index b457007c..da5a0918 100644 --- a/mallocx.c +++ b/mallocx.c @@ -464,6 +464,8 @@ GC_API void * GC_CALL GC_memalign(size_t align, size_t lb) /* is a multiple of align. That would be correct up to HBLKSIZE. */ new_lb = lb + align - 1; result = GC_malloc(new_lb); + /* It is ok not to check result for NULL as in that case */ + /* GC_memalign returns NULL too since (0 + 0 % align) is 0. */ offset = (word)result % align; if (offset != 0) { offset = align - offset; -- 2.40.0