]> git.sur5r.net Git - u-boot/blobdiff - common/malloc_simple.c
test/py: Make print statements python 3.x safe
[u-boot] / common / malloc_simple.c
index 0f6bcbcc712d895dbc2235e8029c4fe09f2f4058..c14f8b59c178ee251cc79299f9fcccfbcb1e340a 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Simple malloc implementation
  *
  * Copyright (c) 2014 Google, Inc
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -39,10 +38,14 @@ void *memalign_simple(size_t align, size_t bytes)
 
        addr = ALIGN(gd->malloc_base + gd->malloc_ptr, align);
        new_ptr = addr + bytes - gd->malloc_base;
-       if (new_ptr > gd->malloc_limit)
+       if (new_ptr > gd->malloc_limit) {
+               debug("space exhausted\n");
                return NULL;
+       }
+
        ptr = map_sysmem(addr, bytes);
        gd->malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr));
+       debug("%lx\n", (ulong)ptr);
 
        return ptr;
 }