Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jackie Jiang
wine
Commits
3b3c8619
Commit
3b3c8619
authored
4 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
server: Keep permanent objects on the standard object list.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
25692223
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/object.c
+6
-41
6 additions, 41 deletions
server/object.c
server/object.h
+3
-2
3 additions, 2 deletions
server/object.h
with
9 additions
and
43 deletions
server/object.c
+
6
−
41
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
lis
t
*
p
;
struct
objec
t
*
p
tr
;
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
)
{
...
...
This diff is collapsed.
Click to expand it.
server/object.h
+
3
−
2
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment