xref: /haiku/headers/private/app/ServerMemoryAllocator.h (revision d3d8b26997fac34a84981e6d2b649521de2cc45a)
1 /*
2  * Copyright 2006, 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 namespace BPrivate {
16 
17 class ServerMemoryAllocator {
18 	public:
19 		ServerMemoryAllocator();
20 		~ServerMemoryAllocator();
21 
22 		status_t InitCheck();
23 
24 		status_t AddArea(area_id serverArea, area_id& _localArea, uint8*& _base,
25 					bool readOnly = false);
26 		void RemoveArea(area_id serverArea);
27 
28 		status_t AreaAndBaseFor(area_id serverArea, area_id& area, uint8*& base);
29 
30 	private:
31 		BList	fAreas;
32 };
33 
34 }	// namespace BPrivate
35 
36 #endif	/* SERVER_MEMORY_ALLOCATOR_H */
37