Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a167c3bb
Commit
a167c3bb
authored
Oct 15, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of the memory allocation macros, use real functions instead.
parent
65f7ce21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
29 deletions
+12
-29
debugger.h
programs/winedbg/debugger.h
+4
-26
memory.c
programs/winedbg/memory.c
+8
-3
No files found.
programs/winedbg/debugger.h
View file @
a167c3bb
...
...
@@ -549,32 +549,10 @@ extern int curr_frame;
/* gdbproxy.c */
extern
BOOL
DEBUG_GdbRemote
(
unsigned
int
);
/* Choose your allocator! */
#if 1
/* this one is libc's fast one */
extern
void
*
DEBUG_XMalloc
(
size_t
size
);
extern
void
*
DEBUG_XReAlloc
(
void
*
ptr
,
size_t
size
);
extern
char
*
DEBUG_XStrDup
(
const
char
*
str
);
#define DBG_alloc(x) DEBUG_XMalloc(x)
#define DBG_realloc(x,y) DEBUG_XReAlloc(x,y)
#define DBG_free(x) free(x)
#define DBG_strdup(x) DEBUG_XStrDup(x)
#else
/* this one is slow (takes 5 minutes to load the debugger on my machine),
if someone could make optimized routines so it wouldn't
take so long to load, it could be made default) */
#define DBG_alloc(x) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,x)
#define DBG_realloc(x,y) HeapReAlloc(GetProcessHeap(),0,x,y)
#define DBG_free(x) HeapFree(GetProcessHeap(),0,x)
inline
static
LPSTR
DBG_strdup
(
LPCSTR
str
)
{
INT
len
=
strlen
(
str
)
+
1
;
LPSTR
p
=
DBG_alloc
(
len
);
if
(
p
)
memcpy
(
p
,
str
,
len
);
return
p
;
}
#endif
extern
void
*
DBG_alloc
(
size_t
size
);
extern
void
*
DBG_realloc
(
void
*
ptr
,
size_t
size
);
extern
void
DBG_free
(
void
*
ptr
);
extern
char
*
DBG_strdup
(
const
char
*
str
);
#define DEBUG_STATUS_OFFSET 0x80003000
#define DEBUG_STATUS_INTERNAL_ERROR (DEBUG_STATUS_OFFSET+0)
...
...
programs/winedbg/memory.c
View file @
a167c3bb
...
...
@@ -39,7 +39,7 @@ static void DEBUG_Die(const char* msg)
exit
(
1
);
}
void
*
DEBUG_XM
alloc
(
size_t
size
)
void
*
DBG_
alloc
(
size_t
size
)
{
void
*
res
=
malloc
(
size
?
size
:
1
);
if
(
res
==
NULL
)
...
...
@@ -48,7 +48,7 @@ void* DEBUG_XMalloc(size_t size)
return
res
;
}
void
*
D
EBUG_XReA
lloc
(
void
*
ptr
,
size_t
size
)
void
*
D
BG_rea
lloc
(
void
*
ptr
,
size_t
size
)
{
void
*
res
=
realloc
(
ptr
,
size
);
if
((
res
==
NULL
)
&&
size
)
...
...
@@ -56,7 +56,7 @@ void* DEBUG_XReAlloc(void *ptr, size_t size)
return
res
;
}
char
*
DEBUG_XStrD
up
(
const
char
*
str
)
char
*
DBG_strd
up
(
const
char
*
str
)
{
char
*
res
=
strdup
(
str
);
if
(
!
res
)
...
...
@@ -64,6 +64,11 @@ char* DEBUG_XStrDup(const char *str)
return
res
;
}
void
DBG_free
(
void
*
ptr
)
{
free
(
ptr
);
}
enum
dbg_mode
DEBUG_GetSelectorType
(
WORD
sel
)
{
#ifdef __i386__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment