Deleted Added
full compact
uwx_env.c (160158) uwx_env.c (160163)
1/*
2Copyright (c) 2003-2006 Hewlett-Packard Development Company, L.P.
3Permission is hereby granted, free of charge, to any person
4obtaining a copy of this software and associated documentation
5files (the "Software"), to deal in the Software without
6restriction, including without limitation the rights to use,
7copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the

--- 8 unchanged lines hidden (view full) ---

17OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22OTHER DEALINGS IN THE SOFTWARE.
23*/
24
1/*
2Copyright (c) 2003-2006 Hewlett-Packard Development Company, L.P.
3Permission is hereby granted, free of charge, to any person
4obtaining a copy of this software and associated documentation
5files (the "Software"), to deal in the Software without
6restriction, including without limitation the rights to use,
7copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the

--- 8 unchanged lines hidden (view full) ---

17OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22OTHER DEALINGS IN THE SOFTWARE.
23*/
24
25#ifndef _KERNEL
25#include <stdlib.h>
26#include <stdlib.h>
27#endif
26
27#include "uwx_env.h"
28#include "uwx_scoreboard.h"
29#include "uwx_str.h"
30#include "uwx_trace.h"
31
28
29#include "uwx_env.h"
30#include "uwx_scoreboard.h"
31#include "uwx_str.h"
32#include "uwx_trace.h"
33
34#ifdef _KERNEL
35static struct uwx_env uwx_env;
36#define free(p) /* nullified */
37#define malloc(sz) ((sz == sizeof(uwx_env)) ? &uwx_env : NULL)
38#endif
39
32alloc_cb uwx_allocate_cb = 0;
33free_cb uwx_free_cb = 0;
34
35int uwx_register_alloc_cb(alloc_cb alloc, free_cb free)
36{
37 uwx_allocate_cb = alloc;
38 uwx_free_cb = free;
39 return UWX_OK;

--- 52 unchanged lines hidden (view full) ---

92 env->uinfo_hdr = 0;
93 env->uinfo_end = 0;
94 env->code_start = 0;
95 env->text_base = 0;
96 (void)uwx_init_history(env);
97 if (uwx_allocate_cb != NULL)
98 env->allocate_cb = uwx_allocate_cb;
99 else
40alloc_cb uwx_allocate_cb = 0;
41free_cb uwx_free_cb = 0;
42
43int uwx_register_alloc_cb(alloc_cb alloc, free_cb free)
44{
45 uwx_allocate_cb = alloc;
46 uwx_free_cb = free;
47 return UWX_OK;

--- 52 unchanged lines hidden (view full) ---

100 env->uinfo_hdr = 0;
101 env->uinfo_end = 0;
102 env->code_start = 0;
103 env->text_base = 0;
104 (void)uwx_init_history(env);
105 if (uwx_allocate_cb != NULL)
106 env->allocate_cb = uwx_allocate_cb;
107 else
100 env->allocate_cb = malloc;
108 env->allocate_cb = NULL;
101 if (uwx_free_cb != NULL)
102 env->free_cb = uwx_free_cb;
103 else
109 if (uwx_free_cb != NULL)
110 env->free_cb = uwx_free_cb;
111 else
104 env->free_cb = free;
112 env->free_cb = NULL;
105 env->free_scoreboards = 0;
106 env->used_scoreboards = 0;
107 env->labeled_scoreboards = 0;
108 (void)uwx_init_str_pool(env, str_pool);
109 env->module_name = 0;
110 env->function_name = 0;
111 env->cb_token = 0;
112 env->copyin = 0;

--- 101 unchanged lines hidden ---
113 env->free_scoreboards = 0;
114 env->used_scoreboards = 0;
115 env->labeled_scoreboards = 0;
116 (void)uwx_init_str_pool(env, str_pool);
117 env->module_name = 0;
118 env->function_name = 0;
119 env->cb_token = 0;
120 env->copyin = 0;

--- 101 unchanged lines hidden ---