Simplified distributed block storage with strong consistency, like in Ceph
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
434 B

  1. // Copyright (c) Vitaliy Filippov, 2019+
  2. // License: VNPL-1.0 (see README.md for details)
  3. #include <stdio.h>
  4. #include "allocator.h"
  5. int main(int narg, char *args[])
  6. {
  7. allocator a(8192);
  8. for (int i = 0; i < 8192; i++)
  9. {
  10. uint64_t x = a.find_free();
  11. if (x == UINT64_MAX)
  12. {
  13. printf("ran out of space %d\n", i);
  14. return 1;
  15. }
  16. a.set(x, true);
  17. }
  18. return 0;
  19. }