Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libmtime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
icon-libraries
libmtime
Commits
e77b15db
Commit
e77b15db
authored
8 years ago
by
Florian Prill
Browse files
Options
Downloads
Patches
Plain Diff
HL interfaces: removed destructors (final).
parent
881ec5c0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libmtime_hl.f90
+1
-53
1 addition, 53 deletions
src/libmtime_hl.f90
with
1 addition
and
53 deletions
src/libmtime_hl.f90
+
1
−
53
View file @
e77b15db
...
...
@@ -29,26 +29,7 @@ module mtime_hl
type
(
datetime
)
::
dt
contains
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! The use of "final" is "potentially" dangerous - it is supported,
! e.g., on gfortran 4.9 only partially. (see
! http://fortranwiki.org/fortran/show/Fortran+2003+status)
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! final is required to prevent memory leaks, when variables go out
! of scope. So this routine will get called only in this case and
! the call is introduced by the compiler - nobody will see those.
! So I will reenable the final but not for gcc odler than gcc5.
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#if __GNUC__ > 4
final
::
t_datetime_deallocate
#endif
procedure
::
to_string
=>
t_datetime_to_string
procedure
::
assign_string
=>
t_datetime_assign_string
procedure
::
add_timedelta
=>
t_datetime_add_timedelta
...
...
@@ -85,9 +66,6 @@ module mtime_hl
contains
#if __GNUC__ > 4
final
::
t_timedelta_deallocate
#endif
procedure
::
to_string
=>
t_timedelta_to_string
procedure
::
assign_string
=>
t_timedelta_assign_string
...
...
@@ -97,29 +75,6 @@ module mtime_hl
contains
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! In my opinion, this deallocate does not make sense, since the
! this%dt data member is a simply derived type (with C conforming
! kind values). The necessary deallocates happen in the wrapper
! routines, where a POINTER variable is used and its contents are
! copied to this%dt.
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! You're right, but this routine is just the implementation of
! final, and no user should call it explicitly! BUt of course,
! you need to make the call available.
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
subroutine
t_datetime_deallocate
(
this
)
type
(
t_datetime
),
target
,
intent
(
inout
)
::
this
type
(
datetime
),
pointer
::
tmp_dt
tmp_dt
=
this
%
dt
if
(
associated
(
tmp_dt
))
call
deallocateDatetime
(
tmp_dt
)
end
subroutine
t_datetime_deallocate
! Convert t_datetime object to string.
!
function
t_datetime_to_string
(
this
)
...
...
@@ -204,13 +159,6 @@ contains
class
(
t_datetime
),
intent
(
in
)
::
dt
t_datetime_greater_or_equal
=
(
this
%
dt
>=
dt
%
dt
)
end
function
t_datetime_greater_or_equal
subroutine
t_timedelta_deallocate
(
this
)
type
(
t_timedelta
),
intent
(
inout
)
::
this
type
(
timedelta
),
pointer
::
tmp_td
tmp_td
=
this
%
td
if
(
associated
(
tmp_td
))
call
deallocateTimedelta
(
tmp_td
)
end
subroutine
t_timedelta_deallocate
! Convert t_timedelta object to string.
!
...
...
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