Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm MALLOC()/FREE() are not to be used for variable-size...



details:   https://anonhg.NetBSD.org/src/rev/32bd3e4a790f
branches:  trunk
changeset: 495664:32bd3e4a790f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Aug 02 20:23:23 2000 +0000

description:
MALLOC()/FREE() are not to be used for variable-sized allocations.

diffstat:

 sys/uvm/uvm_aobj.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 2485b18bee2b -r 32bd3e4a790f sys/uvm/uvm_aobj.c
--- a/sys/uvm/uvm_aobj.c        Wed Aug 02 20:21:36 2000 +0000
+++ b/sys/uvm/uvm_aobj.c        Wed Aug 02 20:23:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_aobj.c,v 1.33 2000/06/27 17:29:19 mrg Exp $        */
+/*     $NetBSD: uvm_aobj.c,v 1.34 2000/08/02 20:23:23 thorpej Exp $    */
 
 /*
  * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -437,7 +437,7 @@
                                pool_put(&uao_swhash_elt_pool, elt);
                        }
                }
-               FREE(aobj->u_swhash, M_UVMAOBJ);
+               free(aobj->u_swhash, M_UVMAOBJ);
        } else {
                int i;
 
@@ -457,7 +457,7 @@
                                simple_unlock(&uvm.swap_data_lock);
                        }
                }
-               FREE(aobj->u_swslots, M_UVMAOBJ);
+               free(aobj->u_swslots, M_UVMAOBJ);
        }
 
        /*
@@ -530,7 +530,7 @@
                        if (aobj->u_swhash == NULL)
                                panic("uao_create: hashinit swhash failed");
                } else {
-                       MALLOC(aobj->u_swslots, int *, pages * sizeof(int),
+                       aobj->u_swslots = malloc(pages * sizeof(int),
                            M_UVMAOBJ, mflags);
                        if (aobj->u_swslots == NULL)
                                panic("uao_create: malloc swslots failed");



Home | Main Index | Thread Index | Old Index