]> granicus.if.org Git - gc/commitdiff
Add comment in GC_memalign
authorIvan Maidanski <ivmai@mail.ru>
Fri, 8 Jun 2012 17:13:14 +0000 (21:13 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 8 Jun 2012 17:13:14 +0000 (21:13 +0400)
* mallocx.c (GC_memalign): Add comment for GC_malloc invocation result.

mallocx.c

index b457007c0c48df932d90a05fc7183233e774d60c..da5a0918f58e7fbf10ba434ee21aa4e0e83aa246 100644 (file)
--- 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;