* src/mm/memory.c (vm/vm.h): Added.
authortwisti <none@none>
Wed, 12 Jul 2006 22:55:05 +0000 (22:55 +0000)
committertwisti <none@none>
Wed, 12 Jul 2006 22:55:05 +0000 (22:55 +0000)
(memory_cnew): Replaced throw_cacao_exception_exit with vm_abort.
(dump_release): Likewise.

* src/toolbox/util.c (_Jv_getcwd): Likewise.

src/mm/memory.c
src/toolbox/util.c

index 90c81ade1aa16e4b759d71fc1ccfc670df6cba91..a43ae9b3ebecfb8270f5c37ff6eb35780316a8e6 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Christian Thalinger
                        Edwin Steiner
 
    Changes: Christian Thalinger
                        Edwin Steiner
 
-   $Id: memory.c 5123 2006-07-12 21:45:34Z twisti $
+   $Id: memory.c 5126 2006-07-12 22:55:05Z twisti $
 
 */
 
 
 */
 
@@ -70,6 +70,7 @@
 #include "vm/options.h"
 #include "vm/statistics.h"
 #include "vm/stringlocal.h"
 #include "vm/options.h"
 #include "vm/statistics.h"
 #include "vm/stringlocal.h"
+#include "vm/vm.h"
 
 
 /*******************************************************************************
 
 
 /*******************************************************************************
@@ -136,7 +137,7 @@ static void *memory_checked_alloc(s4 size)
 
        void *p = calloc(size, 1);
 
 
        void *p = calloc(size, 1);
 
-       if (!p)
+       if (p == NULL)
                exceptions_throw_outofmemory_exit();
 
        return p;
                exceptions_throw_outofmemory_exit();
 
        return p;
@@ -197,8 +198,7 @@ void *memory_cnew(s4 size)
                /* make the memory read-, write-, and executeable */
 
                if (mprotect(p, codememsize, PROT_READ | PROT_WRITE | PROT_EXEC) == -1)
                /* make the memory read-, write-, and executeable */
 
                if (mprotect(p, codememsize, PROT_READ | PROT_WRITE | PROT_EXEC) == -1)
-                       throw_cacao_exception_exit(string_java_lang_InternalError,
-                                                                          strerror(errno));
+                       vm_abort("mprotect failed: %s", strerror(errno));
 
                /* set global code memory pointer */
 
 
                /* set global code memory pointer */
 
@@ -253,7 +253,7 @@ void *mem_realloc(void *src, s4 len1, s4 len2)
 
        dst = realloc(src, len2);
 
 
        dst = realloc(src, len2);
 
-       if (!dst)
+       if (dst == NULL)
                exceptions_throw_outofmemory_exit();
 
        return dst;
                exceptions_throw_outofmemory_exit();
 
        return dst;
@@ -452,9 +452,8 @@ void dump_release(s4 size)
 
        di = DUMPINFO;
 
 
        di = DUMPINFO;
 
-       if (size < 0 || size > di->useddumpsize)
-               throw_cacao_exception_exit(string_java_lang_InternalError,
-                                                                  "Illegal dump release size %d", size);
+       if ((size < 0) || (size > di->useddumpsize))
+               vm_abort("Illegal dump release size: %d", size);
 
        /* reset the used dump size to the size specified */
 
 
        /* reset the used dump size to the size specified */
 
index 9540761e72180af5b9c50b262739241a131c1a7b..e340742c882de4edb91cfd23456f15624ef026d5 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
 
    Changes:
 
-   $Id: util.c 5104 2006-07-10 17:22:18Z twisti $
+   $Id: util.c 5126 2006-07-12 22:55:05Z twisti $
 
 */
 
 
 */
 
@@ -77,8 +77,7 @@ char *_Jv_getcwd(void)
                /* too small buffer or a more serious problem */
 
                if (errno != ERANGE)
                /* too small buffer or a more serious problem */
 
                if (errno != ERANGE)
-                       throw_cacao_exception_exit(string_java_lang_InternalError,
-                                                                          strerror(errno));
+                       vm_abort("getcwd failed: %s", strerror(errno));
 
                /* double the buffer size */
 
 
                /* double the buffer size */