haiku/headers/private/app/ServerMemoryAllocator.h
Axel Dörfler 9a44fdc97c * Implemented a new client allocation method: instead of having all bitmaps of
all teams in serveral server areas, and instead of having to eventually clone
  them all several times in BBitmap, we now have one or more areas per team,
  and BBitmap will only clone areas once if needed. As a side effect, this
  method should be magnitudes faster than the previous version.
* This method is also much more secure: instead of putting the allocation
  maintenance structures into those everyone-read-write areas, they are now
  separated, so that faulty applications cannot crash the app_server this
  way anymore. This should fix bug #172.
* Freeing memory is not yet implemented though! (although all memory will
  be freed upon app exit)
* There are now 3 different bitmap allocation strategies: per ClientMemoryAllocator
  (ie. via ServerApp), per area (for overlays, not yet implemented), and using
  malloc()/free() for server-only bitmaps.
* ServerBitmap now deletes its buffers itself.
* Cleaned up BBitmap and BApplication a bit.
* The test environment currently doesn't build anymore, will fix it next.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16826 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-18 13:43:26 +00:00

36 lines
701 B
C++

/*
* Copyright 2006, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Axel Dörfler, axeld@pinc-software.de
*/
#ifndef SERVER_MEMORY_ALLOCATOR_H
#define SERVER_MEMORY_ALLOCATOR_H
#include <OS.h>
#include <List.h>
namespace BPrivate {
class ServerMemoryAllocator {
public:
ServerMemoryAllocator();
~ServerMemoryAllocator();
status_t InitCheck();
status_t AddArea(area_id serverArea, area_id& _localArea, uint8*& _base);
void RemoveArea(area_id serverArea);
status_t AreaAndBaseFor(area_id serverArea, area_id& area, uint8*& base);
private:
BList fAreas;
};
} // namespace BPrivate
#endif /* SERVER_MEMORY_ALLOCATOR_H */