Content-type: text/html Manpage of shgmalloc

shgmalloc

Section: C Library Functions (3)
Updated: 13 January 2000
Index Return to Main Contents
 

NAME

msm_init, msm_extend, msm_set_autodestruct_state, msm_heap_attach, msm_heap_detach, msm_sbrk, hstat, msm_lockop, msm_lockobjectaddr, msm_lockmemop, get_free_mapslot, find_object, map_object, unmap_object, map_name2index, map_addr2index, map_name2addr, map_index2name, mapname_unique, map_setinfo, map_setsize, map_objectshow, map_show, msm_hdes2name, msm_name2hdes, msm_isync_heaptables, msm_sync_heaptables, msm_lockobjectname, get_free_clislot, map_client, unmap_client, client_show, msm_heap_homeostat, msm_exit, msm_shobject_exists, map_address_mode, msm_name2index, msm_fdes2hdes, msm_addr_in_heap, msm_map_haddr_to_paddr, msm_map_paddr_to_haddr, initialize_heap, shmalloc, _shfree_internal, shfree, shcfree, shrealloc, shcalloc, __default_shmorecore  

SYNOPSIS

void msm_init(int max_sheaps);

void msm_extend
(
       int from_size,

       int to_size

);

int msm_set_autodestruct_state
(
       int hdes,

       int autodestruct

);

int msm_heap_attach
(
       char *map_f_path,

       int flags,

       int prot_mode,

       int map_mode,

       int homeostasis_mode

);

int msm_heap_detach
(
       int hdes,

       int flags

);

void *msm_sbrk
(
       int hdes,

       unsigned long size

);

int hstat
(
       int hdes,

       heap_type *heapinfo

);

int msm_lockop
(
       int hdes,

       int cmd,

       void *addr,

       unsigned long size,

       int io_op

);

void *msm_lockobjectaddr
(
       int hdes,

       int cmd,

       void *addr,

       int io_op

);

int msm_lockmemop
(
       int hdes,

       int cmd,

       int io_op

);

int get_free_mapslot(int hdes);

int find_object
(
       int hdes,

       void *ptr

);

int map_object
(
       int hdes,

       int index,

       void *ptr,

       char *name

);

int unmap_object
(
       int hdes,

       int index

);

int map_name2index
(
       int hdes,

       char *name

);

int map_addr2index
(
       int hdes,

       void *addr

);

void *map_name2addr
(
       int hdes,

       char *name

);

char *map_index2name
(
       int hdes,

       int index

);

int mapname_unique
(
       int hdes,

       char *name

);

int map_setinfo
(
       int hdes,

       int index,

       char *info

);

int map_setsize
(
       int hdes,

       int index,

       unsigned long size

);

int map_objectshow
(
       int hdes,

       int index,

       FILE *stream

);

int map_show
(
       int hdes,

       FILE *stream

);

char *msm_hdes2name(int hdes);

int msm_name2hdes(char *name);

int msm_isync_heaptables(int hdes);

int msm_sync_heaptables(int hdes);

void *msm_lockobjectname
(
       int hdes,

       int cmd,

       char *name,

       int io_op

);

int get_free_clislot(int hdes);

int map_client
(
       int hdes,

       int index,

       char *hostname,

       char *hostprocname,

       int hostprocpid

);

int unmap_client
(
       int hdes,

       int pid,

       char *name

);

int client_show
(
       int hdes,

       FILE *stream

);

int msm_heap_homeostat
(
       void *t_info,

       char *args

);

void msm_exit
(
       FILE *stream,

       int flags

);

int msm_shobject_exists
(
       int hdes,

       char *name

);

int map_address_mode
(
       int hdes,

       int mode

);

int msm_name2index(char *name);

int msm_fdes2hdes(int fdes);

int msm_addr_in_heap
(
       int hdes,

       void *ptr

);

void *msm_map_haddr_to_paddr
(
       int hdes,

       void *ptr

);

void *msm_map_paddr_to_haddr
(
       int hdes,

       void *ptr

);

int initialize_heap(int);

void *shmalloc
(
       int hdes,

       size_t size,

       char *name

);

void _shfree_internal
(
       int hdes,

       void *ptr

);

void *shfree
(
       int hdes,

       void *ptr

);

void shcfree
(
       int hdes,

       void *ptr

);

void *shrealloc
(
       int hdes,

       void *ptr,

       size_t size,

       char *name

);

void *shcalloc
(
       int hdes,

       size_t nmemb,

       size_t size,

       char *name

);

void *__default_shmorecore
(
       int hdes,

       ptrdiff_t increment

);
 

PARAMETERS

int max_sheaps
Not Documented.
int from_size
Not Documented.
int to_size
Not Documented.
int hdes
Not Documented.
int autodestruct
Not Documented.
char *map_f_path
Not Documented.
int flags
Not Documented.
int prot_mode
Not Documented.
int map_mode
Not Documented.
int homeostasis_mode
Not Documented.
unsigned long size
Not Documented.
heap_type *heapinfo
Not Documented.
int cmd
Not Documented.
void *addr
Not Documented.
int io_op
Not Documented.
void *ptr
Not Documented.
int index
Not Documented.
char *name
Not Documented.
char *info
Not Documented.
FILE *stream
Not Documented.
int hdes
Not Documented.
char *hostname
Not Documented.
char *hostprocname
Not Documented.
int hostprocpid
Not Documented.
int pid
Not Documented.
void *t_info
Not Documented.
char *args
Not Documented.
int mode
Not Documented.
int fdes
Not Documented.
int
Not Documented.
size_t size
Not Documented.
size_t nmemb
Not Documented.
ptrdiff_t increment
Not Documented.
 

DESCRIPTION

 

msm_init

Initialise (local process) variables associated with shared heap ...  

msm_extend

Extend (local process) variables associated with shared heap ...  

msm_set_autodestruct_state

Tell heap to destroy itself when we detach it ...  

msm_heap_attach

Return a handle to the shared heap whose pathname is map_f_path. The flags specifies the (file) I/O mode the shared heap, and mode specifies the level of file protection ...  

msm_heap_detach

Detach a shared heap -- if flags | O_DESTROY the shared heap is unlinked by this process -- if all processes attached to it specify O_DESTROY, the shared heap will be destroyed as soon as the last process has detached it ...  

msm_sbrk

Sbrk on the shared heap whose heap descriptor is hdes - size extra bytes will be mapped into the address spaces of all processes which are attached to the heap ...  

hstat

Routine to stat a heap (in a similar manner to stat on a file) ...  

msm_lockop

Lock operations on object within a shared memory segment (allowing the caller exclusive access to it) ...  

msm_lockobjectaddr

Apply a lock to a mapped object pointer ...  

msm_lockmemop

Apply a lock to the whole of a shared memory ...  

get_free_mapslot

Find first free named shared object slot in the map area ...  

find_object

Find mapped object (returning its index) ...  

map_object

Add a shared object to the shared object map ...  

unmap_object

Remove a shared object from the shared object map ...  

map_name2index

Translate a shared object map name to index ...  

map_addr2index

Translate a shared object map name to index ...  

map_name2addr

Translate a shared object map name to address ...  

map_index2name

Translate shared object map index to name ...  

mapname_unique

Make sure that a mapname is unique ...  

map_setinfo

Set the info field for a mapped object ...  

map_setsize

Set the size field for a mapped object ...  

map_objectshow

Display statistics of object in shared memory ...  

map_show

Display mapped objects in shared memory ...  

msm_hdes2name

Translate shared memory hdes to name ...  

msm_name2hdes

Translate shared memory name to hdes ...  

msm_isync_heaptables

Synchronise backing store copy of heaptable with that in memory ...  

msm_sync_heaptables

Synchronise memory copy of heaptable with that in backing store ...  

msm_lockobjectname

Lock a shared object returning pointer to it (in the address space of the client process) ...  

get_free_clislot

Find first free client info slot in the map area ...  

map_client

Add a client to the shared object client info map ...  

unmap_client

Remove a client from the shared client map ...  

client_show

Display clients using shared memory ...  

msm_heap_homeostat

Client homeostat - removes dead client(s) from heap and protects the heaps file system resources ...  

msm_exit

Shared heap exit function (which detaches any shared heaps) ...  

msm_shobject_exists

Check to see if an object already exists ...  

map_address_mode

Make sure heap addresses are in either absolute (local) or relative ...  

msm_name2index

Translate heap name to heap table index ...  

msm_fdes2hdes

Translate heap fdes to heap table index ...  

msm_addr_in_heap

Check to see if an address lies within shared heap ...  

msm_map_haddr_to_paddr

Resolve address pointer on shared heap into address space of calling process ...  

msm_map_paddr_to_haddr

Resolve address pointer on shared heap into address space of calling process ...  

initialize_heap

Heap initialisation - called by heap_attach function.  

shmalloc

Allocate memory from the heap.  

_shfree_internal

Return memory to the heap. Like `free' but don't call a __free_hook if there is one.  

shfree

Return memory to the heap.  

shcfree

Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc. This file is part of the GNU C Library.

The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Shared heap code by Mark O'Neill (mao@tumblingdice.co.uk).  

shrealloc

Resize the given region to the new size, returning a pointer to the (possibly moved) region. This is optimized for speed; some benchmarks seem to indicate that greater compactness is achieved by unconditionally allocating and copying to a new region. This module has incestuous knowledge of the internals of both free and malloc.  

shcalloc

Allocate an array of NMEMB elements each SIZE bytes long. The entire array is initialized to zeros.  

__default_shmorecore

Allocate INCREMENT more bytes of data space, and return the start of data space, or NULL on errors. If INCREMENT is negative, shrink data space.


 

Index

NAME
SYNOPSIS
PARAMETERS
DESCRIPTION
msm_init
msm_extend
msm_set_autodestruct_state
msm_heap_attach
msm_heap_detach
msm_sbrk
hstat
msm_lockop
msm_lockobjectaddr
msm_lockmemop
get_free_mapslot
find_object
map_object
unmap_object
map_name2index
map_addr2index
map_name2addr
map_index2name
mapname_unique
map_setinfo
map_setsize
map_objectshow
map_show
msm_hdes2name
msm_name2hdes
msm_isync_heaptables
msm_sync_heaptables
msm_lockobjectname
get_free_clislot
map_client
unmap_client
client_show
msm_heap_homeostat
msm_exit
msm_shobject_exists
map_address_mode
msm_name2index
msm_fdes2hdes
msm_addr_in_heap
msm_map_haddr_to_paddr
msm_map_paddr_to_haddr
initialize_heap
shmalloc
_shfree_internal
shfree
shcfree
shrealloc
shcalloc
__default_shmorecore

This document was created by man2html, using the manual pages.
Time: 16:36:10 GMT, January 10, 2008