You are on page 1of 4

DSA Assignment – 4

Anmol Asati

SR - 19716

Implementation detail:
OneBin:
For One Bin Setup there are two make files ‘make_file_t’ &
‘makefile_polynomial_test1’. There is one_bin_t file which consists main
implementation details. And this .c file calling OneBin which consists
ob_malloc() & ob_free() functions.
To test with polynomial there is make file ‘makefile_polynomial_test1’.
Weighted Buddy:
For Weighted buddy setup there are two main make files
‘makefile_weighted_buddy_t ’ – This make file consists of weighted_buddy_t
and Weighted_buddy . weighted_buddy_t is calling Weighted_buddy which is
having main Implementation details.
Other make file is ‘makefile_polyBuddy_t’ – This is for testing with polynomial.
Here in this setup…
External fragmentation is calculated as the ratio of amount of unallocated
memory to total memory, during overflow. Which, when multiplied by 100,
gives the corresponding percentages.
Internal fragmentation is calculated as the ratio of total sum of the differences
between sizes of the allocated blocks & the sires of the corresponding requests
to the total memory size, which when multiplied by too gives corresponding
percentages.
Output:

1.1 makefile_one_bin_t

1.2 makefile_polynomial_test1
2.1 makefile_weighted_buddy_t

Observations:
By experimenting multiple times on Polynomial. It can be concluded that
average time for One Bin allocator is less as compared to Weighted Buddy
allocator.
Space & Time Complexity:
To perform timing comparisons, we are timing only the memory management
calls that are made as part of the polynomial programs. This allows us to
compare the allocators directly without having to worry about external factors
It can be show that OneBin allocator is well performed to the WeightedBuddy
allocator. And, this is expected as both the allocation and de-allocation
operations of OneBin are order of O(1).
Also, when it comes to memory efficiency, OneBin is well. The reason being
that we have specialized OneBin so that each of the fixed size bins have exactly
the size required by the Polynomial program.

You might also like