Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3b3c8619
Commit
3b3c8619
authored
Sep 23, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Keep permanent objects on the standard object list.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
25692223
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
43 deletions
+9
-43
object.c
server/object.c
+6
-41
object.h
server/object.h
+3
-2
No files found.
server/object.c
View file @
3b3c8619
...
...
@@ -52,22 +52,13 @@ struct namespace
#ifdef DEBUG_OBJECTS
static
struct
list
object_list
=
LIST_INIT
(
object_list
);
static
struct
list
static_object_list
=
LIST_INIT
(
static_object_list
);
void
dump_objects
(
void
)
{
struct
list
*
p
;
struct
object
*
ptr
;
LIST_FOR_EACH
(
p
,
&
static_object_list
)
{
struct
object
*
ptr
=
LIST_ENTRY
(
p
,
struct
object
,
obj_list
);
fprintf
(
stderr
,
"%p:%d: "
,
ptr
,
ptr
->
refcount
);
dump_object_name
(
ptr
);
ptr
->
ops
->
dump
(
ptr
,
1
);
}
LIST_FOR_EACH
(
p
,
&
object_list
)
LIST_FOR_EACH_ENTRY
(
ptr
,
&
object_list
,
struct
object
,
obj_list
)
{
struct
object
*
ptr
=
LIST_ENTRY
(
p
,
struct
object
,
obj_list
);
fprintf
(
stderr
,
"%p:%d: "
,
ptr
,
ptr
->
refcount
);
dump_object_name
(
ptr
);
ptr
->
ops
->
dump
(
ptr
,
1
);
...
...
@@ -76,17 +67,11 @@ void dump_objects(void)
void
close_objects
(
void
)
{
struct
list
*
ptr
;
struct
object
*
obj
,
*
obj2
;
/* release the static objects */
while
((
ptr
=
list_head
(
&
static_object_list
)))
{
struct
object
*
obj
=
LIST_ENTRY
(
ptr
,
struct
object
,
obj_list
);
/* move it back to the standard list before freeing */
list_remove
(
&
obj
->
obj_list
);
list_add_head
(
&
object_list
,
&
obj
->
obj_list
);
release_object
(
obj
);
}
/* release the permanent objects */
LIST_FOR_EACH_ENTRY_SAFE
(
obj
,
obj2
,
&
object_list
,
struct
object
,
obj_list
)
if
(
obj
->
is_permanent
)
release_object
(
obj
);
dump_objects
();
/* dump any remaining objects */
}
...
...
@@ -406,26 +391,6 @@ void unlink_named_object( struct object *obj )
free
(
name_ptr
);
}
/* mark an object as being permanent, i.e. only released at shutdown */
void
make_object_permanent
(
struct
object
*
obj
)
{
obj
->
is_permanent
=
1
;
#ifdef DEBUG_OBJECTS
list_remove
(
&
obj
->
obj_list
);
list_add_head
(
&
static_object_list
,
&
obj
->
obj_list
);
#endif
}
/* mark an object as no longer permanent */
void
make_object_temporary
(
struct
object
*
obj
)
{
obj
->
is_permanent
=
0
;
#ifdef DEBUG_OBJECTS
list_remove
(
&
obj
->
obj_list
);
list_add_head
(
&
object_list
,
&
obj
->
obj_list
);
#endif
}
/* grab an object (i.e. increment its refcount) and return the object */
struct
object
*
grab_object
(
void
*
ptr
)
{
...
...
server/object.h
View file @
3b3c8619
...
...
@@ -145,8 +145,6 @@ extern void *create_named_object( struct object *parent, const struct object_ops
extern
void
*
open_named_object
(
struct
object
*
parent
,
const
struct
object_ops
*
ops
,
const
struct
unicode_str
*
name
,
unsigned
int
attributes
);
extern
void
unlink_named_object
(
struct
object
*
obj
);
extern
void
make_object_permanent
(
struct
object
*
obj
);
extern
void
make_object_temporary
(
struct
object
*
obj
);
extern
struct
namespace
*
create_namespace
(
unsigned
int
hash_size
);
extern
void
free_kernel_objects
(
struct
object
*
obj
);
/* grab/release_object can take any pointer, but you better make sure */
...
...
@@ -180,6 +178,9 @@ extern void dump_objects(void);
extern
void
close_objects
(
void
);
#endif
static
inline
void
make_object_permanent
(
struct
object
*
obj
)
{
obj
->
is_permanent
=
1
;
}
static
inline
void
make_object_temporary
(
struct
object
*
obj
)
{
obj
->
is_permanent
=
0
;
}
/* event functions */
struct
event
;
...
...
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