1 /* Access for application keys in mmap'd malloc managed region.
2 Copyright 1992 Free Software Foundation, Inc.
4 Contributed by Fred Fish at Cygnus Support. fnf@cygnus.com
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21 /* This module provides access to some keys that the application can use to
22 provide persistent access to locations in the mapped memory section.
23 The intent is that these keys are to be used sparingly as sort of
24 persistent global variables which the application can use to reinitialize
25 access to data in the mapped region.
27 For the moment, these keys are simply stored in the malloc descriptor
28 itself, in an array of fixed length. This should be fixed so that there
29 can be an unlimited number of keys, possibly using a multilevel access
30 scheme of some sort. */
35 mmalloc_setkey (md
, keynum
, key
)
40 struct mdesc
*mdp
= (struct mdesc
*) md
;
43 if ((mdp
!= NULL
) && (keynum
>= 0) && (keynum
< MMALLOC_KEYS
))
45 mdp
-> keys
[keynum
] = key
;
52 mmalloc_getkey (md
, keynum
)
56 struct mdesc
*mdp
= (struct mdesc
*) md
;
59 if ((mdp
!= NULL
) && (keynum
>= 0) && (keynum
< MMALLOC_KEYS
))
61 keyval
= mdp
-> keys
[keynum
];
This page took 0.030025 seconds and 4 git commands to generate.