projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve mmu.h.
[pintos-anon]
/
src
/
threads
/
malloc.c
diff --git
a/src/threads/malloc.c
b/src/threads/malloc.c
index ba39d1d926f496115a8cf703265808fa3813f3ea..263651dc6adc28dddf7dc6940394c8b2d90566ea 100644
(file)
--- a/
src/threads/malloc.c
+++ b/
src/threads/malloc.c
@@
-31,7
+31,7
@@
malloc_init (void)
{
size_t slot_size;
{
size_t slot_size;
- for (slot_size = 16; slot_size <
NBPG
; slot_size *= 2)
+ for (slot_size = 16; slot_size <
PGSIZE
; slot_size *= 2)
{
struct desc *d = &descs[desc_cnt++];
ASSERT (desc_cnt <= sizeof descs / sizeof *descs);
{
struct desc *d = &descs[desc_cnt++];
ASSERT (desc_cnt <= sizeof descs / sizeof *descs);
@@
-44,7
+44,7
@@
malloc_init (void)
static struct arena *
slot_to_arena (struct slot *s)
{
static struct arena *
slot_to_arena (struct slot *s)
{
- return (struct arena *) ((uint32_t) s & ~(
NBPG
- 1));
+ return (struct arena *) ((uint32_t) s & ~(
PGSIZE
- 1));
}
static void *
}
static void *
@@
-87,7
+87,7
@@
malloc (size_t size)
a->next = d->arenas;
if (d->arenas != NULL)
d->arenas->prev = a;
a->next = d->arenas;
if (d->arenas != NULL)
d->arenas->prev = a;
- for (ofs = sizeof *a; ofs + d->slot_size <=
NBPG
; ofs += d->slot_size)
+ for (ofs = sizeof *a; ofs + d->slot_size <=
PGSIZE
; ofs += d->slot_size)
{
struct slot *s = (struct slot *) ((uint8_t *) a + ofs);
s->next = d->free_list;
{
struct slot *s = (struct slot *) ((uint8_t *) a + ofs);
s->next = d->free_list;