EBK COMPUTER SYSTEMS
EBK COMPUTER SYSTEMS
3rd Edition
ISBN: 8220101459107
Author: O'HALLARON
Publisher: YUZU
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 9, Problem 9.17HW

Explanation of Solution

Perform Next-fit search instead of First-fit search:

In the “Section 9.9.12 (mm.c)”, remove the lines that starts from “/* $begin mmfirstfit */” and ends with “return NULL; /* No fit */”.

Add the following highlighted code to the “Section 9.9.12 (mm.c)”. The modified “mm.c” file is as follows:

/* Global variables */

static char *heap_listp = 0;  /* Pointer to first block */

// Rover for Next fit

static char *rover;

/* Function prototypes for internal helper routines */

static void *extend_heap(size_t words);

heap_listp += (2 * WSIZE);

/* $end mminit */

// Assign heap_listp to rover

rover = heap_listp;

/* $begin mminit */

/* Extend the empty heap with a free block of CHUNKSIZE bytes */

bp = PREV_BLKP(bp);

}

/* $end mmfree */

// If condition to check the rover is not representing the free block

if ((rover > (char *)bp) && (rover < NEXT_BLKP(bp)))

// Assign bp to rover

rover = bp;

/* $begin mmfree */

return bp;

}

{

/* Next fit search instead of first fit search*/

// Assign rover to the character pointer oldrover

char *oldrover = rover;

/* Finding next fit using for loop */

// For loop to search from rover to the end of the list

for (; GET_SIZE(HDRP(rover)) > 0; rover = NEXT_BLKP(rover))

// If condition to check allocation and size of rover

if (!GET_ALLOC(HDRP(rover)) && (asize <= GET_SIZE(HDRP(rover))))

// Return rover

return rover;

// For loop to search from start of list to old rover

for (rover = heap_listp; rover < oldrover; rover = NEXT_BLKP(rover))

// If condition to check allocation and size of rover

if (!GET_ALLOC(HDRP(rover)) && (asize <= GET_SIZE(HDRP(rover))))

// Return rover

return rover;

// Otherwise return null

return NULL;

}

/* $end mmfirstfit */

Filename: main.c

// Include libraries

#include <stdio.h>

#include <stdlib.h>

#include <assert.h>

// Include required header files

#include "csapp...

Blurred answer
Students have asked these similar questions
6.19 Consider a bar of p-type silicon that is uniformly doped to a value of N = 2 x 101 cm³ at 7=300 K. The applied electric field is zero. A light source is incident on the end of the semiconductor as shown in Figure P6.19. The steady-state concentration of excess carriers generated at x = 0 is 8p(0) = Sn(0) = 2 x 104 cm³. Assume the following Light p type x=0 Figure P6.19 | Figure for Problems 6.19 and 6.21. parameters: μ = 1200 cm²/V-s, μp = 400 cm²/V-s, T = 10-6 s, and 7p = 5 × 10-7 s. Neglecting surface effects, (a) determine the steady-state excess electron and hole concentrations as a function of distance into the semiconductor, and (b) calculate the steady-state electron and hole diffusion current densities as a function of distance into the semiconductor.
*6.24 Consider the semiconductor described in Problem 6.19. Assume a constant electric field E, is applied in the +x direction. (a) Derive the expression for the steady-state excess electron concentration. (Assume the solution is of the form ea.) (b) Plot on versus x for (i) Eo = 0 and (ii) E₁ = 12 V/cm. (c) Explain the general characteristics of the two curves plotted in part (b).
6.6 Consider a one-dimensional hole flux as shown in Figure 6.4. If the generation rate of holes in this differential volume is gp = 100 cm³-s¹ and the recombination rate is 2 × 1019 cm³-s, what must be the gradient in the particle current density to maintain a steady-state hole concentration?
Knowledge Booster
Background pattern image
Computer Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY