100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Samenvatting hoofdstuk 6: Automatisch Geheugenbeheer

Rating
-
Sold
-
Pages
12
Uploaded on
27-07-2022
Written in
2019/2020

Dit is de samenvatting van het zesde hoofdstuk van het vak Interpretatie van Computerprogramma's I. In deze samenvatting werd zowel alle informatie uit de slides als bijkomende informatie uit eigen notities opgenomen. Aan het einde van de samenvatting werden ook de herhalingsvragen opgelost EINDRESULTAAT: 16/20

Show more Read less
Institution
Course









Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Institution
Study
Course

Document information

Summarized whole book?
No
Which chapters are summarized?
Hoofdstuk 5.3
Uploaded on
July 27, 2022
Number of pages
12
Written in
2019/2020
Type
Summary

Subjects

Content preview

Hoofdstuk 6: automatisch
geheugenbeheer
1 Motivatie
• Registermachines: beperkt aantal registers (= geheugen)
o Normaal: cons, lijsten … → passen niet in registers → bovenop registers ook een
blikje RAM gebruiken
▪ Eindig: efficiënt mee omspringen en dingen die de rest van het programma
niet meer kunnen beïnvloeden, opruimen
▪ Stukjes geheugen die niet meer nodig zijn vrijmaken
➢ Verschillende algoritmes voor: “Stop en copy”

2 Van lijst-gebaseerd naar fysiek geheugen




• Geheugenmodel van Scheme omvormen naar geheugenmodel computer = reeks individueel
adresseerbare cellen
• Pointer = variabele met als waarde het adres van een geheugencel
• The-cars en the-cdrs staan hier onder elkaar maar staan in het echt gewoon naast elkaar
• Getypeerde pointers want we gebruiken een aantal bits van de pointer om een type bij te
houden.

1

, 2.1 Waarden voorstellen als getypeerde pointers




(define BIAS 1000)
(define NMBR-prefix 1)
(define PAIR-prefix 2)
(define NULL-prefix 3)
(define MASK-prefix 4)

(define NMBR (* NMBR-prefix BIAS))
(define PAIR (* PAIR-prefix BIAS))
(define NULL (* NULL-prefix BIAS))
(define MASK (* MASK-prefix BIAS))

(define (PREFIX val)
(quotient (abs val) BIAS))

(define (VALUE val)
(remainder (abs val) BIAS))

(define (MAKE prefix val)
(+ prefix val))

(define (number? val)
(eq? (PREFIX val) NMBR-prefix))

(define (pair? val)
(eq? (PREFIX val) PAIR-prefix))

(define (null? val)
(eq? (PREFIX val) NULL-prefix))

(define (MASK? val)
(eq? (PREFIX val) MASK-prefix))

2.2 Fysieke voorstelling van paren
(define FREE 0)
Eerste vrije entry in de 2 vectoren met cars en cdrs
(define SIZE 9)

(define THE-CARS (make-vector SIZE NULL))
NULL = null-pointer
(define THE-CDRS (make-vector SIZE NULL))



2
$4.22
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Document also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
lennyS Vrije Universiteit Brussel
Follow You need to be logged in order to follow users or courses
Sold
163
Member since
5 year
Number of followers
62
Documents
34
Last sold
2 weeks ago

4.5

6 reviews

5
4
4
1
3
1
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions