Make the bitmap responsible for allocation.
[pintos-anon] / src / lib / kernel / bitmap.h
index f70688b28662e70233cef635a2c1dcece495808b..8aef186f709a6073c6c445f19b20285f2b114d08 100644 (file)
@@ -6,26 +6,7 @@
 
 /* Bitmap abstract data type. */
 
-/* Element type.
-
-   This must be an unsigned integer type at least as wide as int.
-
-   Each bit represents one bit in the bitmap.
-   If bit 0 in an element represents bit K in the bitmap,
-   then bit 1 in the element represents bit K+1 in the bitmap,
-   and so on. */
-typedef unsigned long elem_type;
-
-/* From the outside, a bitmap is an array of bits.  From the
-   inside, it's an array of elem_type (defined above) that
-   simulates an array of bits. */
-struct bitmap
-  {
-    size_t bit_cnt;     /* Number of bits. */
-    elem_type *bits;    /* Elements that represent bits. */
-  };
-
-bool bitmap_init (struct bitmap *, size_t bit_cnt);
+struct bitmap *bitmap_create (size_t bit_cnt);
 void bitmap_destroy (struct bitmap *);
 
 size_t bitmap_size (const struct bitmap *);