Changed the kmalloc()/kfree() calls to malloc()/free().

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1774 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2002-10-29 23:08:35 +00:00
parent 41691b996a
commit 9844285a44
+13 -8
View File
@@ -13,7 +13,7 @@
#include <stdio.h> #include <stdio.h>
#include <memheap.h> #include <malloc.h>
#include <OS.h> #include <OS.h>
#include <string.h> #include <string.h>
#include <debug.h> #include <debug.h>
@@ -223,10 +223,12 @@ __inline unsigned __int8 chrand8 (ch_randgen *prandgen)
/* Initializes Yarrow 2000 Chuma Random Number Generator */ /* Initializes Yarrow 2000 Chuma Random Number Generator */
/* reseeding about 8 times prior to the first use is recommended. */ /* reseeding about 8 times prior to the first use is recommended. */
/* more than 16 will probably be a bit too much as time increases by n^2 */ /* more than 16 will probably be a bit too much as time increases by n^2 */
__inline ch_randgen *new_chrand (const unsigned int inittimes)
__inline ch_randgen *
new_chrand(const unsigned int inittimes)
{ {
ch_randgen *prandgen; ch_randgen *prandgen;
prandgen = (ch_randgen *)kmalloc (sizeof (ch_randgen)); prandgen = (ch_randgen *)malloc(sizeof(ch_randgen));
prandgen->seedptr = prandgen->ira; prandgen->seedptr = prandgen->ira;
prandgen->rndptrX = prandgen->ira; prandgen->rndptrX = prandgen->ira;
prandgen->rndptrA = prandgen->ira; prandgen->rndptrA = prandgen->ira;
@@ -239,13 +241,16 @@ __inline ch_randgen *new_chrand (const unsigned int inittimes)
prandgen->rndptrA = prandgen->ira + chrand (prandgen) % NK; prandgen->rndptrA = prandgen->ira + chrand (prandgen) % NK;
prandgen->rndptrB = prandgen->ira + chrand (prandgen) % NK; prandgen->rndptrB = prandgen->ira + chrand (prandgen) % NK;
return prandgen; return prandgen;
} }
/* Clean up after chuma */ /* Clean up after chuma */
__inline void kill_chrand (ch_randgen *randgen) __inline void
kill_chrand(ch_randgen *randgen)
{ {
memset (randgen, 0, sizeof (ch_randgen)); memset(randgen, 0, sizeof (ch_randgen));
kfree (randgen); free(randgen);
} }
/* ++++++++++ /* ++++++++++
driver.c driver.c
A skeletal device driver A skeletal device driver