Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Brice Videau
CCS
Commits
b04251e1
Commit
b04251e1
authored
Jul 30, 2020
by
Brice Videau
Browse files
Fix memory leak.
parent
ade5ece6
Changes
2
Hide whitespace changes
Inline
Side-by-side
bindings/python/cconfigspace/configuration_space.py
View file @
b04251e1
...
...
@@ -228,13 +228,13 @@ class ConfigurationSpace(Context):
v
=
ccs_configuration
()
res
=
ccs_configuration_space_get_default_configuration
(
self
.
handle
,
ct
.
byref
(
v
))
Error
.
check
(
res
)
return
Configuration
.
from_handle
(
v
)
return
Configuration
(
handle
=
v
,
retain
=
False
)
def
sample
(
self
):
v
=
ccs_configuration
()
res
=
ccs_configuration_space_sample
(
self
.
handle
,
ct
.
byref
(
v
))
Error
.
check
(
res
)
return
Configuration
.
from_handle
(
v
)
return
Configuration
(
handle
=
v
,
retain
=
False
)
def
samples
(
self
,
count
):
if
count
==
0
:
...
...
@@ -242,6 +242,6 @@ class ConfigurationSpace(Context):
v
=
(
ccs_configuration
*
count
)()
res
=
ccs_configuration_space_samples
(
self
.
handle
,
count
,
v
)
Error
.
check
(
res
)
return
[
Configuration
.
from_handle
(
x
)
for
x
in
v
]
return
[
Configuration
(
handle
=
ccs_configuration
(
x
),
retain
=
False
)
for
x
in
v
]
from
.configuration
import
Configuration
bindings/python/cconfigspace/tuner.py
View file @
b04251e1
...
...
@@ -92,7 +92,7 @@ class Tuner(Object):
res
=
ccs_tuner_ask
(
self
.
handle
,
count
,
v
,
ct
.
byref
(
c
))
Error
.
check
(
res
)
count
=
c
.
value
return
[
Configuration
.
from_
handle
(
ccs_configuration
(
v
[
x
]))
for
x
in
range
(
count
)]
return
[
Configuration
(
handle
=
ccs_configuration
(
v
[
x
])
,
retain
=
False
)
for
x
in
range
(
count
)]
def
tell
(
self
,
evaluations
):
count
=
len
(
evaluations
)
...
...
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