1 /* 2 * Copyright 2006-2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 */ 8 #ifndef SERVER_MEMORY_ALLOCATOR_H 9 #define SERVER_MEMORY_ALLOCATOR_H 10 11 12 #include <OS.h> 13 #include <List.h> 14 15 16 namespace BPrivate { 17 18 19 class ServerMemoryAllocator { 20 public: 21 ServerMemoryAllocator(); 22 ~ServerMemoryAllocator(); 23 24 status_t InitCheck(); 25 26 status_t AddArea(area_id serverArea, area_id& _localArea, 27 uint8*& _base, size_t size, 28 bool readOnly = false); 29 void RemoveArea(area_id serverArea); 30 31 status_t AreaAndBaseFor(area_id serverArea, 32 area_id& area, uint8*& base); 33 34 private: 35 BList fAreas; 36 }; 37 38 39 } // namespace BPrivate 40 41 42 #endif // SERVER_MEMORY_ALLOCATOR_H 43