The OpenNET Project
 
Поиск (ключи):    ПРОГРАММЫ СТАТЬИ СОВЕТЫ ФОРУМ
  WIKI НОВОСТИ (+) MAN'ы ДОКУМЕНТАЦИЯ

Каталог документации / Раздел "Программирование, языки" / Оглавление документа

Memory Allocators

Memory Allocators — deprecated way to allocate chunks of memory for GList, GSList and GNode.

Краткое описание


#include <glib.h>


            GAllocator;
GAllocator* g_allocator_new                 (const gchar *name,
                                             guint n_preallocs);
void        g_allocator_free                (GAllocator *allocator);

Описание

Prior to 2.10, GAllocator was used as an efficient way to allocate small pieces of memory for use with the GList, GSList and GNode data structures. Начиная с версии 2.10, it has been completely replaced by the slice allocator and deprecated.

Детали

GAllocator

typedef struct _GAllocator GAllocator;

Внимание

GAllocator устарела и не должна использоваться во вновь создаваемом коде.

The GAllocator struct contains private data. and should only be accessed using the following functions.


g_allocator_new ()

GAllocator* g_allocator_new                 (const gchar *name,
                                             guint n_preallocs);

Внимание

g_allocator_new has been deprecated since version 2.10 and should not be used in newly-written code. Use the slice allocator instead

Creates a new GAllocator.

name : the name of the GAllocator. This name is used to set the name of the GMemChunk used by the GAllocator, and is only used for debugging.
n_preallocs : the number of elements in each block of memory allocated. Larger blocks mean less calls to g_malloc(), but some memory may be wasted. (GLib uses 128 elements per block by default.) The value must be between 1 and 65535.
Возвращает : a new GAllocator.

g_allocator_free ()

void        g_allocator_free                (GAllocator *allocator);

Внимание

g_allocator_free has been deprecated since version 2.10 and should not be used in newly-written code. Use the slice allocator instead

Frees all of the memory allocated by the GAllocator.

allocator : GAllocator.

ПОДПИШИСЬ НА ЖУРНАЛ Linux Format 2012!

Журнал "Linux Format" (Линукс Формат)- Единственный в России и странах СНГ журнал на русском языке, посвящённый Linux и свободному ПО. Журнал для IT-директоров, IT-менеджеров, программистов, системных администраторов, учителей школ и преподавателей ВУЗов и всех пользователей ПК. В каждом выпуске: Новости индустрии OpenSource, обзоры новинок свободного ПО, обучающие и методические статьи.

Каждый, кто оформит подписку, получает бонусы и подарки- объёмные наклейки на системный блок, диск с архивом номеров за 2005-2011 г.г. и ежемесячно электронную версию журнала в pdf-формате.

Оформить подписку на год


  Закладки на сайте
  Проследить за страницей
Created 1996-2012 by Maxim Chirkov  
ДобавитьРекламаВебмастеруГИД  
RUNNet TopList