Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
jobthai
jobthai-ios-swift
Commits
da310cbf
Commit
da310cbf
authored
8 years ago
by
Pinyo Chanchaisomphob (โย)
Browse files
Options
Download
Patches
Plain Diff
remove memory use report.
parent
cada1947
develop
before_remove_auto_login
TestFlight_3.0.0_20161102
Sprint#33_Build_3.0.0_21
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
JobThai/JobThai/JTMHomeViewController.swift
+0
-35
JobThai/JobThai/JTMHomeViewController.swift
with
0 additions
and
35 deletions
+0
-35
JobThai/JobThai/JTMHomeViewController.swift
+
0
−
35
View file @
da310cbf
...
...
@@ -27,7 +27,6 @@ class JTMHomeViewController: JTMBaseMenuViewController,JTMLandingPageViewDelagat
@IBOutlet
weak
var
landingPage
:
JTMLandingPageView
?
@IBOutlet
weak
var
urgentJobsView
:
JTMUrgentJobsView
?
@IBOutlet
weak
var
memoryLabel
:
UILabel
?
// @IBOutlet weak var landingPageHeight: NSLayoutConstraint!
var
homeObject
:
HomeModel
?
...
...
@@ -86,41 +85,7 @@ class JTMHomeViewController: JTMBaseMenuViewController,JTMLandingPageViewDelagat
applicationDelegate
.
trackGoogleAnalyticScreen
(
SCREEN_HOME
)
self
.
scrollView
.
contentSize
.
height
=
(
self
.
landingPage
?
.
frame
.
height
)
!
+
(
self
.
corporateView
?
.
frame
.
height
)
!
+
(
self
.
browseJobsView
?
.
frame
.
height
)
!
+
(
self
.
hotJobsView
?
.
frame
.
height
)
!
+
(
self
.
urgentJobsView
?
.
frame
.
height
)
!
//Pinyooo Report Memory
self
.
memoryLabel
?
.
text
=
report_memory
()
}
func
report_memory
()
->
String
{
// constant
let
MACH_TASK_BASIC_INFO_COUNT
=
(
sizeof
(
mach_task_basic_info_data_t
)
/
sizeof
(
natural_t
))
// prepare parameters
let
name
=
mach_task_self_
let
flavor
=
task_flavor_t
(
MACH_TASK_BASIC_INFO
)
var
size
=
mach_msg_type_number_t
(
MACH_TASK_BASIC_INFO_COUNT
)
// allocate pointer to mach_task_basic_info
var
infoPointer
=
UnsafeMutablePointer
<
mach_task_basic_info
>.
alloc
(
1
)
// call task_info - note extra UnsafeMutablePointer(...) call
let
kerr
=
task_info
(
name
,
flavor
,
UnsafeMutablePointer
(
infoPointer
),
&
size
)
// get mach_task_basic_info struct out of pointer
let
info
=
infoPointer
.
move
()
// deallocate pointer
infoPointer
.
dealloc
(
1
)
// check return value for success / failure
if
kerr
==
KERN_SUCCESS
{
return
"Memory in use (in MB):
\(
info
.
resident_size
/
1000000
)
"
}
else
{
let
errorString
=
String
(
CString
:
mach_error_string
(
kerr
),
encoding
:
NSASCIIStringEncoding
)
return
errorString
??
"Error: couldn't parse error string"
}
}
override
func
viewDidDisappear
(
animated
:
Bool
)
{
super
.
viewDidDisappear
(
animated
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets