mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 686805 part 1 - Make Mappable::munmap, Mappable1stPagePtr::munmap and MappedPtr::munmap private. r=tglek
This commit is contained in:
parent
b07c58481d
commit
826e3fb405
@ -86,10 +86,12 @@ public:
|
||||
, mappable(mappable)
|
||||
{ }
|
||||
|
||||
private:
|
||||
friend class GenericMappedPtr<Mappable1stPagePtr>;
|
||||
void munmap(void *buf, size_t length) {
|
||||
mappable->munmap(buf, length);
|
||||
}
|
||||
private:
|
||||
|
||||
Mappable *mappable;
|
||||
};
|
||||
|
||||
|
@ -206,7 +206,7 @@ public:
|
||||
#ifdef ANDROID
|
||||
~_MappableBuffer() {
|
||||
/* Free the additional page we allocated. See _MappableBuffer::Create */
|
||||
munmap(this + ((GetLength() + PAGE_SIZE) & ~(PAGE_SIZE - 1)), PAGE_SIZE);
|
||||
::munmap(this + ((GetLength() + PAGE_SIZE) & ~(PAGE_SIZE - 1)), PAGE_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -26,10 +26,16 @@ public:
|
||||
|
||||
virtual void *mmap(const void *addr, size_t length, int prot, int flags,
|
||||
off_t offset) = 0;
|
||||
|
||||
private:
|
||||
virtual void munmap(void *addr, size_t length) {
|
||||
::munmap(addr, length);
|
||||
}
|
||||
/* Limit use of Mappable::munmap to classes that keep track of the address
|
||||
* and size of the mapping. This allows to ignore ::munmap return value. */
|
||||
friend class Mappable1stPagePtr;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Indicate to a Mappable instance that no further mmap is going to happen.
|
||||
*/
|
||||
|
@ -247,6 +247,8 @@ struct MappedPtr: public GenericMappedPtr<MappedPtr>
|
||||
: GenericMappedPtr<MappedPtr>(buf, length) { }
|
||||
MappedPtr(): GenericMappedPtr<MappedPtr>() { }
|
||||
|
||||
private:
|
||||
friend class GenericMappedPtr<MappedPtr>;
|
||||
void munmap(void *buf, size_t length)
|
||||
{
|
||||
::munmap(buf, length);
|
||||
|
Loading…
Reference in New Issue
Block a user