QMallocPool Class Reference
|
Constant | Value | Description |
---|---|---|
QMallocPool::Owned | 0 | The bookkeeping data is maintained in the QMallocPool instance. Allocation to the pool is only possible via this instance. |
QMallocPool::NewShared | 1 | The bookkeeping data is maintained in the managed region itself. This allows multiple QMallocPool instances, possibly in separate processes, to allocate from the pool. |
The NewShared PoolType also initializes this bookkeeping data to its default state. Thus, while the bookkeeping data is shared, only one of the sharing instances should use a NewShared type. All other instances should use the Shared pool type.
The malloc pool bookkeeping data contains absolute pointers. As such, if multiple processes intend to allocate into the malloc pool, is is essential that they map the memory region to the same virtual address location.
Constant | Value | Description |
---|---|---|
QMallocPool::Shared | 2 | The bookkeeping data is stored in the managed region, and has previously been initialized by another QMallocPool instance constructed using the NewShared pool type. |
The malloc pool bookkeeping data contains absolute pointers. As such, if multiple processes intend to allocate into the malloc pool, is is essential that they map the memory region to the same virtual address location.
Creates an invalid QMallocPool.
Creates a QMallocPool on the memory region poolBase of length poolLength. The pool will be constructed with the passed type and name. The name is used for diagnostics purposes only.
Destroys the malloc pool.
Allocates memory for an array of nmemb elements of size each and returns a pointer to the allocated memory. The memory is set to zero. Returns 0 if the memory could not be allocated.
Outputs statistical information regarding the state of the malloc pool using qLog().
Frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined behaviour occurs. If ptr is 0, no operation is performed.
Returns true if this is a valid malloc pool. Invalid malloc pools cannot be allocated from.
Allocates size bytes and returns a pointer to the allocated memory. The memory is not cleared. Returns 0 if the memory could not be allocated.
Returns a MemoryStats structure containing information about the memory use of this pool.
Changes the size of the memory block pointed to by ptr to size bytes. The contents will be unchanged to the minimum of the old and new sizes; newly allocated memory will be uninitialized. If ptr is 0, the call is equivalent to malloc(size); if size is equal to zero, the call is equivalent to free(ptr). Unless ptr is 0, it must have been returned by an earlier call to malloc(), calloc() or realloc(). If the area pointed to was moved, a free(ptr) is done.
Returns the allocated size of mem, assuming mem was previously returned by malloc(), calloc() or realloc().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt qtextended4.4 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com